PDA

Click to See Complete Forum and Search --> : forms


flog3941
Nov 15th, 2002, 10:13 PM
I have two forms

form1 has a textbox and a button
when i click that button i show form2

and in form2 i wan tto read whats in the textbox on form1
and write an if statement based on whats in the text box

ex..If textbox1.text ="1979" then
blah blah blah
Else if textbox1.text="1980" then
blah blah blah
Else
Blah
end if


How do i do this?

MrPolite
Nov 15th, 2002, 10:25 PM
change Form2's new constructor:
Public sub New(byval txt as string)
'OR
Public sub New(byval txtBox as TextBox)
'now you can read the stuff in the textbox....


when the button is clicked:

dim frm as new form2( textbox1.text)
frm.show