Jump to content
carter2408

Visual Basic : Vreau sa se bifeze RadioButton1 automat atunci cand scriu un cuvant1

Recommended Posts

Posted

Vreau sa se bifeze RadioButton1 automat atunci cand scriu un cuvant1 in TextBox. Si la un alt cuvant2 sa se bifeze RadioButton2 .

Acum 12 ore am luat codul de pe

https://msdn.microsoft.com/en-us/library/system.windows.forms.radiobutton.performclick(v=vs.100).aspx

pe care l-am modificat si a mers .

Codul modificat de mine arata cam asa

If (TextBox1.Text = "Item1") And RadioButton2.Checked Then

RadioButton1.PerformClick()

End If

If (TextBox1.Text = "Item2") And RadioButton1.Checked Then

RadioButton2.PerformClick()

End If

Nu inteleg de ce nu mai merge ?

Posted

fa asa


If TextBox1.Text = "item1" And RadioButton1.Checked = False Then
RadioButton1.Checked = True
ElseIf TextBox1.Text = "item2" And RadioButton2.Checked = False Then
RadioButton2.Checked = True
Else
RadioButton1.Checked = False
RadioButton2.Checked = False
End If

pune asta pe eventul textbox textchanged

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...