Click to See Complete Forum and Search --> : <---Absolute n00b Please help me *[Resolved]*
breemer
Feb 9th, 2003, 10:11 AM
All i am doing is trying to get my head around the new syntax for VERY simple things, such as moving between forms and then back again, i can go from form1 to form2 using this:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
finalize() 'or i could hide it with me.hide
form2.StartPosition = FormStartPosition.CenterScreen
form2.Show()
End Sub
but i want to be able to unload the form like the way you can in VB6 and then be able to open it again later so i can make a welcome page for example
Iouri
Feb 9th, 2003, 10:14 AM
Originally posted by breemer
All i am doing is trying to get my head around the new syntax for VERY simple things, such as moving between forms and then back again, i can go from form1 to form2 using this:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
finalize() 'or i could hide it with me.hide
form2.StartPosition = FormStartPosition.CenterScreen
form2.Show()
End Sub
but i want to be able to unload the form like the way you can in VB6 and then be able to open it again later so i can make a welcome page for example
in form1 on button click
dim f as new form2
Me.Hide
f.Show
breemer
Feb 9th, 2003, 10:36 AM
i have tried that before but when i want to show it again using f1.show (or whatever) it shows me this:
An unhandled exception of type 'System.NullReferenceException' occurred in Between Forms.exe
Additional information: Object reference not set to an instance of an object.
breemer
Feb 9th, 2003, 11:57 AM
i can hide and re-show a form from itself using a timer i just cant show a form from a different form.
Evad
Feb 9th, 2003, 12:06 PM
'Create a module:
Module Module1
Public F1 As New Form1()
Public F2 As New Form2()
End Module
' Add this to form1 button click event
F2.Show()
Me.Hide()
' Add this to form2 button click event
F1.Show()
Me.Hide()
breemer
Feb 9th, 2003, 12:16 PM
Cheers, that'll do.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.