Results 1 to 6 of 6

Thread: <---Absolute n00b Please help me *[Resolved]*

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Posts
    4

    Unhappy <---Absolute n00b Please help me *[Resolved]*

    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:
    VB Code:
    1. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    2.         finalize() 'or i could hide it with me.hide
    3.         form2.StartPosition = FormStartPosition.CenterScreen
    4.         form2.Show()
    5.     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
    Last edited by breemer; Feb 9th, 2003 at 01:17 PM.

  2. #2
    Member
    Join Date
    Dec 2002
    Location
    NY, USA
    Posts
    52

    Re: <---Absolute n00b Please help me

    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:
    VB Code:
    1. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    2.         finalize() 'or i could hide it with me.hide
    3.         form2.StartPosition = FormStartPosition.CenterScreen
    4.         form2.Show()
    5.     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
    Iouri Boutchkine

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Posts
    4
    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.

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Posts
    4
    i can hide and re-show a form from itself using a timer i just cant show a form from a different form.

  5. #5
    Lively Member
    Join Date
    May 2002
    Posts
    94
    '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()

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Posts
    4
    Cheers, that'll do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width