Dear All,
From the below codes, I can get the values of text boxes x1,x2 in the Textbox1 of form2. (when I write x1 or x2 in the textbox 2 of form2.)
But when I write c1 or c2 in the Textbox1 of form2 then it gives error.
Pl. help me.
(I know that the function used in form 2 returns only value of a textbox, not a variable. Pl. tell me the right function that can return the value of a variable.)
Thanks & Regards
Himanshu Verma
My codes have been shown below:
'In form 1
Public Class Form1
Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
x1.Text = 1
x2.Text = 2
c1 = 10
c2 = 20
End Sub
End Class
'In form 2
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Form1.Controls(TextBox2.Text).Text
End Sub
End Class
'*IN MODULE
Module Module1
Public c1, c2 As Integer
End Module