j'aimerai déjà mettre un radiobutton par defaulttu mets sa propriété Checked à True.
Quand ont clique sur un bouton ca va check qu'elle radiobutton est coché et va executer un code celon le radiobutton cocher
If radio1.Checked Then '.... Else If radio2.Checked Then 'etc...
là faut être plus précis, car "sauvegarder" peut correspondre à plein de choses.
que quand ont clique sur l'une des radiobutton cela le sauvegarde
Private Sub OptionCaptura_Load(sender As Object, e As EventArgs) Handles MyBase.Load If RadioButton1.Checked = True Then My.Settings.check1 = RadioButton1.Checked ElseIf RadioButton2.Checked = True Then My.Settings.check1 = RadioButton2.Checked End If End Sub
If RadioButton1.Checked = True Then 'si le radio est vrai My.Settings.check1 = RadioButton1.Checked 'tu mets le setting vrai ElseIf RadioButton2.Checked = True Then 'sinon si l'autre radio est vrai My.Settings.check1 = RadioButton2.Checked 'tu mets aussi le setting vrai End If
If OptionCaptura.RadioButton2.Checked = True Then Me.Hide() TakeScreenshot() Visioneur.Show() ElseIf OptionCaptura.RadioButton2.Checked = False Then MsgBox("cc") End If
Private Sub OptionCaptura_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing My.Settings.check1 = RadioButton1.Checked My.Settings.Save() End Sub Private Sub OptionCaptura_Load(sender As Object, e As EventArgs) Handles Me.Load RadioButton1.Checked = My.Settings.check1 End Sub
If OptionCaptura.RadioButton2.Checked = True Then Me.Hide() TakeScreenshot() Visioneur.Show() ElseIf OptionCaptura.RadioButton2.Checked = False Then MsgBox("cc") End If
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionFor Each CtrL As RadioButton In gpYOptions.Controls ' pr chq radioBouton ds le groupe.collection If CtrL.Checked Then ' si le controle est sélectionné choix_str = CtrL.Name ' le choix est le controle.nom End If Next