Hi all, I have created an Event handler to a function for clicking a generated button, now when this button is clicked need to paste in a textbox the Combobox.seleteditem (that it's a string. Each generated one (Combobox, textbox, button) will have a selected index of the Combobox that it's different, but that is not the problem because I put it in an if, the issues it's that I can't put inside this sub all the three-component. After all, it tells me that the windows form button cannot be a textbox, etc. Do I need to put another two event handlers for textbox and Combobox? (The code below it's a workaround, but I Like to do this with a button)
Public Sub btn_Click(sender As System.Object, ByVal e As System.EventArgs)
'Dim btn As New Button
'btn = CType(sender, Button)
'Dim txt As New TextBox
'txt = CType(sender, TextBox)
Dim cbx As New ComboBox
cbx = CType(sender, ComboBox)
TextBox4.Text += cbx.SelectedItem.ToString & vbCrLf
End Sub