
CodePudding user response:
Writing in the clickIf ctype (sender, RadioButton.) Ckecked=True then
TextBox1. Text=ctype (sender, RadioButton.) the Text
CodePudding user response:
Here is like that, I have 31, is a click each button to add the triggerCodePudding user response:
The comboBox, a localCodePudding user response:
Can write with the parameters of the object in a click sender judgment which selectedCodePudding user response:
Can you give me the reference codeCodePudding user response:
Public Class Form1
Private Sub Form1_Load (ByVal sender As System. Object, ByVal e the As System. EventArgs) Handles MyBase. Load
'all RadioButton within enumeration GroupBox1
'will CheckedChanged events are bound to the Group1_RadioButton_CheckedChanged function
For Each Item As Control In GroupBox1. Controls,
If the Item. GetType=GetType (RadioButton) Then
AddHandler TryCast (Item, RadioButton). CheckedChanged, AddressOf Group1_RadioButton_CheckedChanged
End the If
Next
End Sub
'all RadioButton CheckedChanged events within the group in response to this
Private Sub Group1_RadioButton_CheckedChanged (ByVal sender As System. Object, ByVal e the As System. EventArgs)
TextBox1. Text=TryCast (sender, RadioButton.) Text
End Sub
The End of the Class