MedVision ad

Visual Basic .NET help! (1 Viewer)

SW220

New Member
Joined
Oct 8, 2003
Messages
28
Gender
Male
HSC
2003
Im currently using the 2002 build of .net.

For example,
Lets say I have two forms:

___________________________
| Form 1 X |
|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|
| Enter Age: [textboxage] |
| |
| [commandshowform] |
|___________________________|

^^ Where textboxage is a textbox that the user inputs their age into
^^ Where commandshowform is a command button that shows form2 and hides the current form

___________________________
| Form 2 X |
|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|
| YOU ARE: [label1] |
| |
| [commandexit] |
|___________________________|

^^ Where label1 displays the text typed by the user in form1's textboxage. Now in VB6 all you had to do was go label1.text = form1.textboxage.text BUT in .NET you cant do that!
^^ Where commandexit closes the program



Now my question is how do you get Form2's label1 to show the data that has been typed in form1?! Ive been trying everything and i cant get it to work! Damn .nET!


Any help would be much appreciated.
 

SW220

New Member
Joined
Oct 8, 2003
Messages
28
Gender
Male
HSC
2003
Well since my beautiful ascii art didnt work, ive attached an image of what im tlaking about.
 

Winston

Active Member
Joined
Aug 30, 2002
Messages
6,128
Gender
Undisclosed
HSC
2003
This is called Object Oriented Programming deal with it

Assuming First form is called Form1, and second form which has your text in it is called Form 2



in the button of form 1, also assuming your labels name is Label1



i.e. your command button put this in


Dim frm2 as new Form2()

frm2.Label1.text = Me.TextBox1.text
frm2.Show()
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top