I have a run time made button, and a run time made textbox. How do I change the text of the textbox in the button handler please?
VB.NET:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myBtn As New Button
With myBtn
.Height = 30
.Width = 30
.Top = 100
.Left = 100
.Text = "OK"
End With
AddHandler myBtn.Click, AddressOf myEvent
Me.Controls.Add(myBtn)
Dim myTxt As New TextBox
With myTxt
.Height = 30
.Width = 200
.Top = 100
.Left = 140
.Text = ""
End With
Me.Controls.Add(myTxt)
End Sub
Sub myEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
' How to change myTxt.Text here?
End Sub
End Class