|
-
May 11th, 2004, 07:34 AM
#1
Thread Starter
Junior Member
making different forms show?
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
-
May 11th, 2004, 09:07 AM
#2
New Member
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
......
vb .Net ,CW5, Sybase, Crystal Reports.
-
May 11th, 2004, 09:14 AM
#3
Thread Starter
Junior Member
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?
-
May 11th, 2004, 09:19 AM
#4
Everything is a class in .NET includ8ing forms.
-
May 11th, 2004, 09:24 AM
#5
New Member
you will have to try that...
Let me know if that works, tho.
vb .Net ,CW5, Sybase, Crystal Reports.
-
May 11th, 2004, 09:28 AM
#6
Err. no it wont work. You have to instantiate the form.
There is no such thing as 'inserting a form'
-
May 11th, 2004, 09:31 AM
#7
New Member
you will have to try that...
Let me know if that works, tho.
vb .Net ,CW5, Sybase, Crystal Reports.
-
May 11th, 2004, 11:38 AM
#8
Thread Starter
Junior Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|