I am new to VB.NET. I am trying to create dynamically objects and giving them the event handles. Something like this
Expand|Select|Wrap|Line Numbers
- Dim NewTab As New TabPage
- Dim NewTextBox As New TextBox
- Dim NewTab2 As New TabPage
- Dim b As New Button
- AddHandler b.Click, AddressOf b1
- Me.TabControl1.Controls.Add(NewTab)
- NewTab.Controls.Add(NewTextBox)
- NewTab.Controls.Add(b)
- Private Sub b1(ByVal sender As System.Object, ByVal e As System.EventArgs)
- MsgBox("Here I want the value of the textbox")
- End Sub
Actually i am making on pressing F4
key a new tabpage, and on that page i have a button and a text box. I call a button:
Dim b as new Button and box as Dim t as new Textbox
Now I added a handler for click.
Now How can I pass the text box value to a handler function? i.e. how can I see the text box value after clciking the button.
May be somebody can help me.