newbie vb6 question =(

Status
Not open for further replies.

elitesoldier

In Runtime
Messages
131
Ok, I just started coding my first project. Most of it is done (yay), but now im coding the math part, and it involves reading data from the other forms. So this is what I have so far. I make three forms: form1, form2, and form3. Form1 and 2 has a textbox (text1 and text2), where the user will input a number into them. In form3, i want the program to read what the user typed in text1 and 2 and then mutiply them and put it into a label (label1). The problem im running into is that i can't figure out how to read the data in text1 and 2 =( How do i declare text1 and 2 so that form3 can read the data in them???

thanks =)
 
Have 1 command button in each form.
Here is the code for the first form.

Public Sub Command1_Click()
Form1.Hide
Form2.Show
End Sub

Second form -

Public Sub Command1_Click()
Form2.Hide
Form3.Show
End Sub


Third Form

Public Sub Command1_Click()
Label1.Caption = Form1.Text1.Text * Form2.Text2.Text
End Sub


And voila :D
(Ps, you dont have to have text1 and text 2, since theyre on different forms, they can both be text1, but if youre making a large project, its best to name them something like 'frm1txt' and 'frm2txt', etc, to avoid confusion.)

Hope this helped :D
 
Status
Not open for further replies.
Back
Top Bottom