VB.NET and FORMS (Form.Show, Form.Hide ... )

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • genetic.error@lycos.com

    VB.NET and FORMS (Form.Show, Form.Hide ... )


    I'm moving from Vb6 to VB.Net. I have a feeling this has come up
    before...

    The VS.Net MSDN file seems to state that the following should work:

    Form1.Show
    Form1.Visible = True
    Form1.Hide
    Form1.Visible = False
    Load (Form1)
    Unload (Form1) or perhaps Close (Form1)

    Yet, as you know, none of these work. I also checked a book on
    converting VB6 to VB.Net, and it also seems to say that the above is
    correct. So I'm guessing my syntax is wrong. Corrections will be
    appreciated, particularly since I've been pulling my hair out doing
    this and I'm starting to run low on hair...

    Thanks



  • What-a-Tool

    #2
    Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

    Dim f As New System.Windows. Forms.Form()

    f.lblDesc.Text = "Did you instantiate your new form like this?"

    f.Show() or...

    f.showdialog() for modal form

    Me.Close() from within form for modal or...

    f.Close() or...

    f.Hide()

    f.dispose()



    <genetic.error@ lycos.com> wrote in message
    news:sg5dnvkhdb aqdpckf4tpe8qfa s97ltb0gv@4ax.c om...[color=blue]
    >
    > I'm moving from Vb6 to VB.Net. I have a feeling this has come up
    > before...
    >
    > The VS.Net MSDN file seems to state that the following should work:
    >
    > Form1.Show
    > Form1.Visible = True
    > Form1.Hide
    > Form1.Visible = False
    > Load (Form1)
    > Unload (Form1) or perhaps Close (Form1)
    >
    > Yet, as you know, none of these work. I also checked a book on
    > converting VB6 to VB.Net, and it also seems to say that the above is
    > correct. So I'm guessing my syntax is wrong. Corrections will be
    > appreciated, particularly since I've been pulling my hair out doing
    > this and I'm starting to run low on hair...
    >
    > Thanks
    >
    >
    >[/color]


    Comment

    • Fergus Cooney

      #3
      Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

      Hi Genetic,

      I'm guessing that you are trying to do those things from another Form. In
      which case it <has> come up before and will again (and again!!)

      Form1 in VB6 can be used to get at the instantiated Form. Form1.Visible is
      the Visible property of the actual Form.

      Form1 in VB.NET is the <class> from which instances of the form can
      created. Form1 as an <object> no longer applies. Form1.Visible fails because
      it is asking for the Visible property of the class, and the class doesn't have
      one - it is only availble to instances of the class.

      If you want to access your 'Form1' from a different Form, (or another
      class, for that matter) you need to have a reference to the instance of that
      Form1. This can be stored globally in a module or passed into the other
      Form/class.

      If this explanation only serves to raise more questions, ask away. :-)

      Regards,
      Fergus


      Comment

      • What-a-Tool

        #4
        Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

        Maybe you can answer a question for me, Fergus?
        Not meaning to but in on someone elses thread, but its kinda related ...

        I suggested
        Form.Close() or ...
        Form.Hide()
        Form.Dispose()

        Form.Close() is the method I have been taught and that I use, however, I
        have run across several code samples (written by people a hell of a lot more
        knowledge than me) that have used the Hide() > Dispose() method.
        Whats the difference?
        ..
        "Fergus Cooney" <filter-1@tesco.net> wrote in message
        news:epWPlnbhDH A.1872@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Hi Genetic,
        >
        > I'm guessing that you are trying to do those things from another Form.[/color]
        In[color=blue]
        > which case it <has> come up before and will again (and again!!)
        >
        > Form1 in VB6 can be used to get at the instantiated Form.[/color]
        Form1.Visible is[color=blue]
        > the Visible property of the actual Form.
        >
        > Form1 in VB.NET is the <class> from which instances of the form can
        > created. Form1 as an <object> no longer applies. Form1.Visible fails[/color]
        because[color=blue]
        > it is asking for the Visible property of the class, and the class doesn't[/color]
        have[color=blue]
        > one - it is only availble to instances of the class.
        >
        > If you want to access your 'Form1' from a different Form, (or another
        > class, for that matter) you need to have a reference to the instance of[/color]
        that[color=blue]
        > Form1. This can be stored globally in a module or passed into the other
        > Form/class.
        >
        > If this explanation only serves to raise more questions, ask away. :-)
        >
        > Regards,
        > Fergus
        >
        >[/color]


        Comment

        • Tom Spink

          #5
          Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

          Hi What-a-Tool,

          You should call Close, because this is the overload and ruler <grins>

          Okay, seriously though. Calling Close will call Dispose, but will also fire
          off some form events, such as the Closing and Closed event.

          As for 'Hide', this simply sets the Visible property of the form to false.

          --
          HTH,
          -- Tom Spink, Über Geek

          Please respond to the newsgroup,
          so all can benefit

          "Chaos, Panic, Disorder, my work here is done"


          "What-a-Tool" <FrigginSpammer sDieDieDie!@cox .net> wrote in message
          news:WGFdb.2862 8$0Z5.24119@lak eread03...
          : Maybe you can answer a question for me, Fergus?
          : Not meaning to but in on someone elses thread, but its kinda related ...
          :
          : I suggested
          : Form.Close() or ...
          : Form.Hide()
          : Form.Dispose()
          :
          : Form.Close() is the method I have been taught and that I use, however, I
          : have run across several code samples (written by people a hell of a lot
          more
          : knowledge than me) that have used the Hide() > Dispose() method.
          : Whats the difference?
          : .
          : "Fergus Cooney" <filter-1@tesco.net> wrote in message
          : news:epWPlnbhDH A.1872@TK2MSFTN GP10.phx.gbl...
          : > Hi Genetic,
          : >
          : > I'm guessing that you are trying to do those things from another
          Form.
          : In
          : > which case it <has> come up before and will again (and again!!)
          : >
          : > Form1 in VB6 can be used to get at the instantiated Form.
          : Form1.Visible is
          : > the Visible property of the actual Form.
          : >
          : > Form1 in VB.NET is the <class> from which instances of the form can
          : > created. Form1 as an <object> no longer applies. Form1.Visible fails
          : because
          : > it is asking for the Visible property of the class, and the class
          doesn't
          : have
          : > one - it is only availble to instances of the class.
          : >
          : > If you want to access your 'Form1' from a different Form, (or
          another
          : > class, for that matter) you need to have a reference to the instance of
          : that
          : > Form1. This can be stored globally in a module or passed into the other
          : > Form/class.
          : >
          : > If this explanation only serves to raise more questions, ask away.
          :-)
          : >
          : > Regards,
          : > Fergus
          : >
          : >
          :
          :


          Comment

          • Fergus Cooney

            #6
            Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

            Hi What-a-Tool,

            Tom's said it. :-)

            It would never occur to me to use Hide and then Dispose (why use two lines
            when one will do). I guess I would if I wanted to skip raising those close
            events. But why? Let's ask these people with a hell of a lot more knowledge!!
            ;-)

            Regards,
            Fergus

            ps Any relation to Peter-o-Tool, or is it just a rampant resemblance?


            Comment

            • Tom Spink

              #7
              Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

              : ps Any relation to Peter-o-Tool, or is it just a rampant resemblance?

              ROFLM*O

              --
              HTH,
              -- Tom Spink, Über Geek

              Please respond to the newsgroup,
              so all can benefit

              "Chaos, Panic, Disorder, my work here is done"


              "Fergus Cooney" <filter-1@tesco.net> wrote in message
              news:Omb42qghDH A.3616@TK2MSFTN GP11.phx.gbl...
              : Hi What-a-Tool,
              :
              : Tom's said it. :-)
              :
              : It would never occur to me to use Hide and then Dispose (why use two
              lines
              : when one will do). I guess I would if I wanted to skip raising those close
              : events. But why? Let's ask these people with a hell of a lot more
              knowledge!!
              : ;-)
              :
              : Regards,
              : Fergus
              :
              : ps Any relation to Peter-o-Tool, or is it just a rampant resemblance?
              :
              :


              Comment

              • What-a-Tool

                #8
                Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

                101 code samples - How to Multi-Threading - form main at the bottom.
                I'm thinking it's pretty safe to say whoever wrote that has a hell of a lot
                more knowledge than me, as I don't have any code samples anywhere on the
                web, nevermind published by Microsoft.
                I've seen it in other samples too, but this is a recent one to me, that
                jumped right to mind.

                No relation to Peter O'Toole.
                What-a-Tool - I'm a Tool and Die Maker by proffession - thats the main
                reference.
                Saying "What-a-Tool" in reference to someone is also like saying
                "What-a-shithead". It's a derogatory comment to make about someone, and it
                made me smile to take it as a screen name.
                Kinda along the same lines as "Genetic.er ror" I suppose.
                Name is Sean, and thanks for enlightening me.


                "Fergus Cooney" <filter-1@tesco.net> wrote in message
                news:Omb42qghDH A.3616@TK2MSFTN GP11.phx.gbl...[color=blue]
                > Hi What-a-Tool,
                >
                > Tom's said it. :-)
                >
                > It would never occur to me to use Hide and then Dispose (why use two[/color]
                lines[color=blue]
                > when one will do). I guess I would if I wanted to skip raising those close
                > events. But why? Let's ask these people with a hell of a lot more[/color]
                knowledge!![color=blue]
                > ;-)
                >
                > Regards,
                > Fergus
                >
                > ps Any relation to Peter-o-Tool, or is it just a rampant resemblance?
                >
                >[/color]


                Comment

                • Fergus Cooney

                  #9
                  Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

                  Hi Sean,

                  || What-a-Tool - I'm a Tool and Die Maker

                  And here we were thinking that you're a superstud -
                  you should have kept quiet. ;-)

                  || 101 code samples

                  Close() is used throughout the examples while Hide() and Dispose() only
                  occurs once. I'd guess that it's spurious. Maybe the code was adapted from a
                  different language where there are different coding styles (eg, WinAPI
                  upbringing). Or perhaps that is that author's style. I can't see it as being
                  much deeper than that.

                  Regards,
                  Fergus


                  Comment

                  • genetic.error@lycos.com

                    #10
                    Re: VB.NET and FORMS (Form.Show, Form.Hide ... )



                    Thank you What A Tool and Fergus Cooney. Yes, I have more
                    questions...

                    1. This little gem in form declarations:
                    Public fMAIN As New System.Windows. Forms.Form
                    plus this in a button click event
                    fMAIN.Hide()
                    Hid the form the old fashioned way - it rebooted my computer. Crude
                    but effective ;) Is there an issue involved with hiding the startup
                    form ?

                    2. How do I refer to the other forms? In other words, assuming I
                    successfully hide the startup form, how do I show another form?

                    I tried this in form declarations for form1 (non startup form):
                    Public fONE As New System.Windows. Forms.Form
                    and then tried this
                    fONE.Show
                    from my startup form. I ended up with "Name fONE is not declared".


                    I also tried:
                    Public f1 As New System.Windows. Forms.Form
                    in a module. At this point, the module doesnt know what form I'm
                    referring to, since i'm not decalring inside a form. So I added:
                    f1 = form1
                    And I got "declaratio n expected" for f1 (which I just declared) .


                    So the confusion continues. Thank you for your explanations, even if I
                    dont have it fixed, I at least have a better idea as to way it's
                    broke. ;)

                    Thanks




                    On Sun, 28 Sep 2003 13:11:51 +0100, "Fergus Cooney"
                    <filter-1@tesco.net> wrote:
                    [color=blue]
                    >Hi Genetic,
                    >
                    > I'm guessing that you are trying to do those things from another Form. In
                    >which case it <has> come up before and will again (and again!!)
                    >
                    > Form1 in VB6 can be used to get at the instantiated Form. Form1.Visible is
                    >the Visible property of the actual Form.
                    >
                    > Form1 in VB.NET is the <class> from which instances of the form can
                    >created. Form1 as an <object> no longer applies. Form1.Visible fails because
                    >it is asking for the Visible property of the class, and the class doesn't have
                    >one - it is only availble to instances of the class.
                    >
                    > If you want to access your 'Form1' from a different Form, (or another
                    >class, for that matter) you need to have a reference to the instance of that
                    >Form1. This can be stored globally in a module or passed into the other
                    >Form/class.
                    >
                    > If this explanation only serves to raise more questions, ask away. :-)
                    >
                    >Regards,
                    >Fergus
                    >[/color]

                    Comment

                    • What-a-Tool

                      #11
                      Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

                      Instead of a start up form, start with Sub Main, instantiate and show your
                      main form from there?

                      <genetic.error@ lycos.com> wrote in message
                      news:fmsfnvkm7n mlrq5f0n4rf1klg asjisq46p@4ax.c om...[color=blue]
                      >
                      >
                      > Thank you What A Tool and Fergus Cooney. Yes, I have more
                      > questions...
                      >
                      > 1. This little gem in form declarations:
                      > Public fMAIN As New System.Windows. Forms.Form
                      > plus this in a button click event
                      > fMAIN.Hide()
                      > Hid the form the old fashioned way - it rebooted my computer. Crude
                      > but effective ;) Is there an issue involved with hiding the startup
                      > form ?
                      >
                      > 2. How do I refer to the other forms? In other words, assuming I
                      > successfully hide the startup form, how do I show another form?
                      >
                      > I tried this in form declarations for form1 (non startup form):
                      > Public fONE As New System.Windows. Forms.Form
                      > and then tried this
                      > fONE.Show
                      > from my startup form. I ended up with "Name fONE is not declared".
                      >
                      >
                      > I also tried:
                      > Public f1 As New System.Windows. Forms.Form
                      > in a module. At this point, the module doesnt know what form I'm
                      > referring to, since i'm not decalring inside a form. So I added:
                      > f1 = form1
                      > And I got "declaratio n expected" for f1 (which I just declared) .
                      >
                      >
                      > So the confusion continues. Thank you for your explanations, even if I
                      > dont have it fixed, I at least have a better idea as to way it's
                      > broke. ;)
                      >
                      > Thanks
                      >
                      >
                      >
                      >
                      > On Sun, 28 Sep 2003 13:11:51 +0100, "Fergus Cooney"
                      > <filter-1@tesco.net> wrote:
                      >[color=green]
                      > >Hi Genetic,
                      > >
                      > > I'm guessing that you are trying to do those things from another[/color][/color]
                      Form. In[color=blue][color=green]
                      > >which case it <has> come up before and will again (and again!!)
                      > >
                      > > Form1 in VB6 can be used to get at the instantiated Form.[/color][/color]
                      Form1.Visible is[color=blue][color=green]
                      > >the Visible property of the actual Form.
                      > >
                      > > Form1 in VB.NET is the <class> from which instances of the form can
                      > >created. Form1 as an <object> no longer applies. Form1.Visible fails[/color][/color]
                      because[color=blue][color=green]
                      > >it is asking for the Visible property of the class, and the class doesn't[/color][/color]
                      have[color=blue][color=green]
                      > >one - it is only availble to instances of the class.
                      > >
                      > > If you want to access your 'Form1' from a different Form, (or another
                      > >class, for that matter) you need to have a reference to the instance of[/color][/color]
                      that[color=blue][color=green]
                      > >Form1. This can be stored globally in a module or passed into the other
                      > >Form/class.
                      > >
                      > > If this explanation only serves to raise more questions, ask away.[/color][/color]
                      :-)[color=blue][color=green]
                      > >
                      > >Regards,
                      > >Fergus
                      > >[/color]
                      >[/color]


                      Comment

                      • Fergus Cooney

                        #12
                        Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

                        Hi Genetic,

                        || fMAIN.Hide() - Hid the form the old fashioned way - it rebooted
                        || my computer. Crude but effective ;)

                        ROFL.
                        Strange though - hiding the startup Form shouldn't present any problems.


                        System.Windows. Forms.Form is a class. In any class, the variables that you
                        declare belong to that class. You can't get to those variables from outside
                        the class without referencing the class - either using the class name or an
                        instantiated object of that class.

                        In other words, if you declare
                        Public fONE As New System.Windows. Forms.Form
                        in the class form1 (non startup form) and call
                        fONE.Show
                        from your startup form, it <will indeed> say "Name fONE is not declared.
                        This is because the startup form doesn't have a variable called fONE - you
                        declared it in form1. You need a form1 to access the variable fONE.

                        There. I'm sure that's cleared that up!!

                        || I also tried: Public f1 As New System.Windows. Forms.Form
                        || in a module.

                        That's fine.

                        || At this point, the module doesnt know what form I'm referring to.

                        Actually you're still mostly fine. The variable f1 has been given an
                        actual Form to show because you used the New keyword. You could say f1.Show
                        and it would work (and give you a blank form). But that declaration is only
                        'mostly' because you're after a form1 not a blank form.

                        || since i'm not decalring inside a form.

                        Strictly speaking, you can declare a form variable anywhere that you can
                        define variables. Declaring form variables inside Form classes is not
                        obligatory.

                        || So I added:
                        || f1 = form1 'Compiler error.
                        || And I got "declaratio n expected" for f1 (which I just declared) .

                        This is again correct. Read my last post again and see if it makes anymore
                        sense. I'll carry on anyway, though. "form1" is the name of the <class>. You
                        can't Show, Hide or do <anything> with a form1 - because it's the name of the
                        class. But you can make <instances> of form1. These will be actual Forms that
                        you <can> show and hide, etc.
                        f1 = form1 won't give you a form1 but you were close. You needed to add
                        the New keyword to make an instance.
                        f1 = New form1

                        =============== =============== =============== ===========
                        This issue is a major stumbling block for many programmers coming from VB6
                        to VB.NET.

                        Forms are no longer just there. They have to be managed. What's worse is
                        that I'm not quite telling the truth. The .NET designers, in an effort to be
                        helpful, have hidden some of the code that, if it had to be done manually,
                        would make things clearer.

                        In C#, if you want a form, you have to code its declaration and its
                        instantiation and then show it. All C# programs start with their "Sub Main".
                        This creates the startup form and off you go. Being explicit means less
                        confusion.

                        In VB, if you don't use Sub Main as your starting point, the compiler
                        effectively creates it for you - behind the scenes. And thus the confusion
                        starts! Here you have an obviously visible form which has appeared out of
                        nowhere. There is no variable with which to access it from outside the form.
                        There is little (to a newcomer from VB6) to say that this Form1 is <not> the
                        form that you can see, but is the class (template) for the form.

                        Create a project with a single form, Form1 and this is what you get
                        (simplified)

                        Class Form1
                        Sub Main
                        Dim f As New Form1
                        Application.Run (f)
                        End Sub

                        Sub New
                        Sub Form1_Load
                        End Class

                        But you never get to see the Sub Main as this is done for you and hidden.
                        In VB6, Form1 would be the class <and> the instance. In VB.NET, Form1 is the
                        class <only> while f, the hidden variable, is the instance.

                        Let's put Sub Main into a module:

                        Module LetsGo
                        Public f As New Form1
                        Sub Main
                        Application.Run (f)
                        End Sub
                        End Module

                        Class Form1
                        Sub New
                        Sub Form1_Load
                        End Class

                        Now you have a global variable, f, which is the actual form. You can
                        access this variable from anywhere and use it to Show and Hide, etc.

                        Ok, that's enough for now.

                        Have a read of this and read my last post again to get as much sense out
                        of them as possible. If possible get a beginning book on VB.NET so that you
                        can read what I've been saying in another way. The distinction that you're
                        after is that Forms and Form classes are now totally distinct where once they
                        were seemingly interchangeable .

                        Come back with any more questions. We'll get you there! :-)

                        Regards,
                        Fergus


                        Comment

                        • genetic.error@lycos.com

                          #13
                          Re: VB.NET and FORMS (Form.Show, Form.Hide ... )


                          Hi Fergus

                          Thank you for your help. Unfortunately, it's still not working, which
                          I dont understand, since your explanation made sense.

                          -----------------------------

                          Regarding the startup form:

                          Public fSTART As New System.Windows. Forms.Form

                          Private Sub Pic1_Click... Handles Pic1.Click

                          fSTART.Hide()
                          MsgBox("Somethi ng worked right !!!")

                          End Sub

                          Well this isnt giving me any errors! The message box even appears. The
                          problem is that when that sub finishes running, the form is visible.

                          -----------------------------

                          On to calling forms from other forms:
                          [color=blue]
                          > In other words, if you declare
                          > Public fONE As New System.Windows. Forms.Form
                          > in the class form1 (non startup form) and call
                          > fONE.Show
                          > from your startup form, it <will indeed> say "Name fONE is not declared.
                          > This is because the startup form doesn't have a variable called fONE - you
                          >declared it in form1. You need a form1 to access the variable fONE.[/color]

                          Okay, so form1.fONE.Show ? That's what I thought, but i was obviously
                          wrong. Error is: "Reference to a non shared member requires an object
                          reference". I have a feeling I was close here...
                          [color=blue]
                          > There. I'm sure that's cleared that up!![/color]

                          No, but I appreciate the effort. :-)

                          -------------------------------

                          On to placing form declarations in the module:
                          [color=blue]
                          > f1 = form1 won't give you a form1 but you were close. You needed to add
                          >the New keyword to make an instance.
                          > f1 = New form1[/color]

                          In the module, this:
                          Public f1 As New System.Windows. Forms.Form
                          f1 = NEW form1
                          caused "Declaratio n Expected". Unfortunately, NEW didnt solve the
                          problem.

                          _______________ _

                          SO, I'm still lost. I appreciate your input and patience. I'm open to
                          more suggestions :)

                          ------------------------------
                          [color=blue]
                          > This issue is a major stumbling block for many programmers coming from VB6
                          >to VB.NET.
                          >[/color]

                          No doubt !!!

                          Comment

                          • What-a-Tool

                            #14
                            Re: VB.NET and FORMS (Form.Show, Form.Hide ... )

                            Don't know if this is what you want, or if it will help, but this worked for
                            me.
                            Added a Sub Main Module as startup item.
                            frmStrt is shown and hidden from SubMain.
                            frmMain is Hidden and reshown from a button_Click event.
                            Hope this helps. Sean

                            Module StartUp

                            Sub Main()

                            Dim frmMain As New frmMain()

                            Dim frmStrt As New frmStrt()

                            frmStrt.Show()

                            System.Threadin g.Thread.Curren tThread.Sleep(5 000)

                            frmStrt.Hide()

                            MessageBox.Show ("#1 Hidden")

                            frmStrt.Close()

                            'Show Main Form

                            frmMain.ShowDia log()

                            End Sub

                            End Module



                            Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
                            System.EventArg s) Handles Button1.Click

                            Me.Hide()

                            MessageBox.Show ("#2 Hidden")

                            Me.Visible = True

                            End Sub







                            <genetic.error@ lycos.com> wrote in message
                            news:6ennnvgm3k rubdqh96n0god8d cg252vtki@4ax.c om...[color=blue]
                            >
                            > Hi Fergus
                            >
                            > Thank you for your help. Unfortunately, it's still not working, which
                            > I dont understand, since your explanation made sense.
                            >
                            > -----------------------------
                            >
                            > Regarding the startup form:
                            >
                            > Public fSTART As New System.Windows. Forms.Form
                            >
                            > Private Sub Pic1_Click... Handles Pic1.Click
                            >
                            > fSTART.Hide()
                            > MsgBox("Somethi ng worked right !!!")
                            >
                            > End Sub
                            >
                            > Well this isnt giving me any errors! The message box even appears. The
                            > problem is that when that sub finishes running, the form is visible.
                            >
                            > -----------------------------
                            >
                            > On to calling forms from other forms:
                            >[color=green]
                            > > In other words, if you declare
                            > > Public fONE As New System.Windows. Forms.Form
                            > > in the class form1 (non startup form) and call
                            > > fONE.Show
                            > > from your startup form, it <will indeed> say "Name fONE is not[/color][/color]
                            declared.[color=blue][color=green]
                            > > This is because the startup form doesn't have a variable called[/color][/color]
                            fONE - you[color=blue][color=green]
                            > >declared it in form1. You need a form1 to access the variable fONE.[/color]
                            >
                            > Okay, so form1.fONE.Show ? That's what I thought, but i was obviously
                            > wrong. Error is: "Reference to a non shared member requires an object
                            > reference". I have a feeling I was close here...
                            >[color=green]
                            > > There. I'm sure that's cleared that up!![/color]
                            >
                            > No, but I appreciate the effort. :-)
                            >
                            > -------------------------------
                            >
                            > On to placing form declarations in the module:
                            >[color=green]
                            > > f1 = form1 won't give you a form1 but you were close. You needed to[/color][/color]
                            add[color=blue][color=green]
                            > >the New keyword to make an instance.
                            > > f1 = New form1[/color]
                            >
                            > In the module, this:
                            > Public f1 As New System.Windows. Forms.Form
                            > f1 = NEW form1
                            > caused "Declaratio n Expected". Unfortunately, NEW didnt solve the
                            > problem.
                            >
                            > _______________ _
                            >
                            > SO, I'm still lost. I appreciate your input and patience. I'm open to
                            > more suggestions :)
                            >
                            > ------------------------------
                            >[color=green]
                            > > This issue is a major stumbling block for many programmers coming[/color][/color]
                            from VB6[color=blue][color=green]
                            > >to VB.NET.
                            > >[/color]
                            >
                            > No doubt !!![/color]


                            Comment

                            Working...