Hi i would like a form on my programe with a button on it, when the users clicks the button it will take them to another form, any idea of how i could do this? or maybe even add a password protected form?
Regards
Homer
Printable View
Hi i would like a form on my programe with a button on it, when the users clicks the button it will take them to another form, any idea of how i could do this? or maybe even add a password protected form?
Regards
Homer
the other form will show when you call it as:
'**** Call the 2nd form ****
Dim mdiForm2 As Form2 'class: define the form2
mdiForm2 = New Form2
mdiForm2.ShowDialog() 'call MDI window as modal
or
mdiForm2.Show() 'call MDI window as normal
you must first build your 2nd form as a class.
Public Class Form2
Inherits System.Windows.Forms.Form
......
build the form as a class?
can't i just insert a new form and make it visible=false so when the button is clicked this enables it?
Everything is a class in .NET includ8ing forms.
you will have to try that...
Let me know if that works, tho.
:bigyello:
Err. no it wont work. You have to instantiate the form.
There is no such thing as 'inserting a form'
you will have to try that...
Let me know if that works, tho.
:bigyello:
hi now created a new form called Form2.vb ive put a button on here and this is the code ive putt on it
Dim Form2 As New Form2()
Form1.Show()
Me.Hide()
Form2.Hide()
its seems to be having a problem with Form1.Show()
"Reference to a non-shared member requires an object reference"
anyone know why?
thanks