![]() |
Button control to link two forms
i want a button to open a form called form2 but how do i do that. i know how to do so in VB6 but not in 2003 please help
|
Just call the 'Show' or 'ShowDialog' Method of the Form e.g.
:
Form2 f = new Form2();The difference between 'Show' and 'ShowDialog' is that 'ShowDialog' shows the called form modal. So you cant access the mainform as long as the called form isnt closed. If you want to exchange data between the two forms you have to pass them in the constructor of 'Form2' or write some public properties. |
thanks
|
that makes a new form, i want a form called form 2 to show up, it is alreeady made.
|
:
Form2.Show |
that doesnt work
|
Well actually Ooble's 'Form2.Show' cant work as long as you havent a static/shared method in your class 'Form2' called 'Show'.
You have to call 'Show' from a created instance of the class 'Form2'. I think its in VB.NET something like this: :
Dim formInstance As Form2 = New Form2 // class member |
Is showing a form really this hard?
|
Apparently so. If the form has already been created, it should be easy. My dog could do it. And I don't even have a dog.
|
Button control to link two forms
Hi,
In the Form1, write the code for the okbutton_click() event as shown below. Private Sub okbutton_Click() Load Form2 Form2.Caption="This is second form" Form2.Show End Sub LOg on to :http://www.vkinfotek.com |
| All times are GMT -5. The time now is 10:54 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC