my not getting the values from the textbox when i pressed the button please see the code and give me a solution please..
i want my textbox value to be displayed in the msgbox with textbox.name and button.name
Public Class Form1
Dim txtadd1 As New TextBox()
Dim txtadd2 As New TextBox()
Dim Buttonadd5 As New Button()
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Paneladd As New Panel
Me.Controls.Add(Paneladd)
For i = 1 To 2
Paneladd.Top = 0
Paneladd.Height = 25
Paneladd.Dock = DockStyle.Top
txtadd1 = New TextBox
txtadd1.Name = "txtadd1" + (i).ToString
txtadd1.Text = "txtadd1" + (i).ToString
txtadd1.Left = 0
txtadd1.Size = New System.Drawing.Size(100, 10)
txtadd1.Enabled = False
txtadd2 = New TextBox
txtadd2.Name = "txtadd2" + (i).ToString
txtadd2.Text = "txtadd2" + (i).ToString
txtadd2.Left = 100
txtadd2.Size = New System.Drawing.Size(100, 10)
txtadd2.Enabled = False
Buttonadd5 = New Button
Buttonadd5.Name = "Buttonadd" + (i).ToString
Buttonadd5.Text = dr.GetValue(0).ToString()
Buttonadd5.Left = 500
Buttonadd5.TextAlign = HorizontalAlignment.Center
Next
Panel3.Controls.Add(Paneladd)
Paneladd.Controls.Add(txtadd1)
Paneladd.Controls.Add(txtadd2)
Paneladd.Controls.Add(Buttonadd5)
End Sub
end class