Opening a form hidden

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Opening a form hidden

    Hi

    I have searched for answer to this question on the net but surprisingly no
    clear answer has come up. How can I open a form hidden in vb.net?

    Thanks

    Regards


  • kimiraikkonen

    #2
    Re: Opening a form hidden

    On Feb 22, 11:39 pm, "John" <J...@nospam.in fovis.co.ukwrot e:
    Hi
    >
    I have searched for answer to this question on the net but surprisingly no
    clear answer has come up. How can I open a form hidden in vb.net?
    >
    Thanks
    >
    Regards
    Use Me.Hide() into your form_load event. Or try to set form's
    visibility property to false.

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Opening a form hidden

      "kimiraikko nen" <kimiraikkonen8 5@gmail.comschr ieb:
      >I have searched for answer to this question on the net but surprisingly
      >no
      >clear answer has come up. How can I open a form hidden in vb.net?
      >
      >Use Me.Hide() into your form_load event. Or try to set form's
      >visibility property to false.
      When 'Load' is executed, the form is still not visible. In addition, the
      form is shown after the 'Load' event has been executed.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      • Armin Zingler

        #4
        Re: Opening a form hidden

        "kimiraikko nen" <kimiraikkonen8 5@gmail.comschr ieb

        I have searched for answer to this question on the net but
        surprisingly no
        clear answer has come up. How can I open a form hidden in vb.net?
        >
        Use Me.Hide() into your form_load event. Or try to set form's
        visibility property to false.

        If the load event fires, there must have been a .Show before. Doesn't
        make sense to Hide something because it's about to be Shown. Instead, I
        wouldn't show it.


        Armin

        Comment

        • RobinS

          #5
          Re: Opening a form hidden

          You can set the position of the form off of the display, like to the right
          of the user's screen, then move it back when you want to show it. Works like
          a charm for me.

          If you do this, don't let the cat sit on the right side of the monitor, so
          he's not harmed when he's hit by the form flying over there... ;-)

          RobinS.
          GoldMail, Inc.
          ------------------------------
          "John" <John@nospam.in fovis.co.ukwrot e in message
          news:%23GaxxtZd IHA.1184@TK2MSF TNGP04.phx.gbl. ..
          Hi
          >
          I have searched for answer to this question on the net but surprisingly no
          clear answer has come up. How can I open a form hidden in vb.net?
          >
          Thanks
          >
          Regards
          >
          >

          Comment

          • Jack Jackson

            #6
            Re: Opening a form hidden

            Be careful of systems with more than one monitor. What is off the
            display on your system might be visible on another display on someone
            else's system.

            On Fri, 22 Feb 2008 18:05:09 -0800, "RobinS" <robins@imnotte lling.com>
            wrote:
            >You can set the position of the form off of the display, like to the right
            >of the user's screen, then move it back when you want to show it. Works like
            >a charm for me.
            >
            >If you do this, don't let the cat sit on the right side of the monitor, so
            >he's not harmed when he's hit by the form flying over there... ;-)
            >
            >RobinS.
            >GoldMail, Inc.
            >------------------------------
            >"John" <John@nospam.in fovis.co.ukwrot e in message
            >news:%23GaxxtZ dIHA.1184@TK2MS FTNGP04.phx.gbl ...
            >Hi
            >>
            >I have searched for answer to this question on the net but surprisingly no
            >clear answer has come up. How can I open a form hidden in vb.net?
            >>
            >Thanks
            >>
            >Regards
            >>
            >>

            Comment

            • kimiraikkonen

              #7
              Re: Opening a form hidden

              On Feb 23, 1:10 am, "Armin Zingler" <az.nos...@free net.dewrote:
              "kimiraikko nen" <kimiraikkone.. .@gmail.comschr ieb
              >
              >
              >
              I have searched for answer to this question on the net but
              surprisingly no
              clear answer has come up. How can I open a form hidden in vb.net?
              >
              Use Me.Hide() into your form_load event. Or try to set form's
              visibility property to false.
              >
              If the load event fires, there must have been a .Show before. Doesn't
              make sense to Hide something because it's about to be Shown. Instead, I
              wouldn't show it.
              >
              Armin
              OK, in this case setting opacity to %0 seems really working way for
              hiding form by default as stated previously.

              Comment

              • RobinS

                #8
                Re: Opening a form hidden

                Give me a teensy amount more credit than that. It pulls the info for the
                screen, and positions the forms off the screen, regardless of how many
                monitors, or the resolution, etc. :-)

                RobinS.
                -------------------------------------
                "Jack Jackson" <jjackson@cinno vations.netwrot e in message
                news:jjavr3hh8j s2qat0f4bdjhlc2 5qr09ml1c@4ax.c om...
                Be careful of systems with more than one monitor. What is off the
                display on your system might be visible on another display on someone
                else's system.
                >
                On Fri, 22 Feb 2008 18:05:09 -0800, "RobinS" <robins@imnotte lling.com>
                wrote:
                >
                >>You can set the position of the form off of the display, like to the right
                >>of the user's screen, then move it back when you want to show it. Works
                >>like
                >>a charm for me.
                >>
                >>If you do this, don't let the cat sit on the right side of the monitor, so
                >>he's not harmed when he's hit by the form flying over there... ;-)
                >>
                >>RobinS.
                >>GoldMail, Inc.
                >>------------------------------
                >>"John" <John@nospam.in fovis.co.ukwrot e in message
                >>news:%23Gaxxt ZdIHA.1184@TK2M SFTNGP04.phx.gb l...
                >>Hi
                >>>
                >>I have searched for answer to this question on the net but surprisingly
                >>no
                >>clear answer has come up. How can I open a form hidden in vb.net?
                >>>
                >>Thanks
                >>>
                >>Regards
                >>>
                >>>

                Comment

                • rowe_newsgroups

                  #9
                  Re: Opening a form hidden

                  On Feb 23, 12:10 am, Jack Jackson <jjack...@cinno vations.netwrot e:
                  Be careful of systems with more than one monitor. What is off the
                  display on your system might be visible on another display on someone
                  else's system.
                  >
                  On Fri, 22 Feb 2008 18:05:09 -0800, "RobinS" <rob...@imnotte lling.com>
                  wrote:
                  >
                  You can set the position of the form off of the display, like to the right
                  of the user's screen, then move it back when you want to show it. Works like
                  a charm for me.
                  >
                  If you do this, don't let the cat sit on the right side of the monitor, so
                  he's not harmed when he's hit by the form flying over there... ;-)
                  >
                  RobinS.
                  GoldMail, Inc.
                  ------------------------------
                  "John" <J...@nospam.in fovis.co.ukwrot e in message
                  news:%23GaxxtZd IHA.1184@TK2MSF TNGP04.phx.gbl. ..
                  Hi
                  >
                  I have searched for answer to this question on the net but surprisingly no
                  clear answer has come up. How can I open a form hidden in vb.net?
                  >
                  Thanks
                  >
                  Regards
                  I usually send it to -10000, if they that many monitors than they
                  deserve to see everything :-)

                  But in reality, I haven't sent a form off screen since my VB6 days,
                  now I usually just toggle the opacity between 0% and 99% when I have a
                  reason to hide and show a form. I do agree with Armin that Sub Main is
                  a better choice if no interaction is required, or the OP could just
                  create a service depending on the purpose of the app. And in case
                  anyone's wondering, whenever I use opacity I only go to 99%, going to
                  100% causes a flicker because of the way Windows paints forms (it has
                  two modes, one for opacity and one for no opacity, switching between
                  the two will flicker the form on painting).

                  Thanks,

                  Seth Rowe [MVP]

                  Comment

                  • rowe_newsgroups

                    #10
                    Re: Opening a form hidden

                    I have searched for answer to this question on the net

                    In my last post I also wanting to thank you for searching for the
                    answer before posting, but it slipped my mind. It's very much
                    appreciated when posters do the legwork before posting.

                    Thanks,

                    Seth Rowe [MVP]

                    Comment

                    • Scott M.

                      #11
                      Re: Opening a form hidden

                      Armin's got the right idea here....

                      Instead of playing tricks with the form (opacity, visibility, position,
                      etc.). Just take control of your application by using a Sub Main and then
                      you can launch the form whenever you need it.

                      While there are other *solutions*, they all scream of "hack".

                      -Scott


                      "John" <John@nospam.in fovis.co.ukwrot e in message
                      news:%23GaxxtZd IHA.1184@TK2MSF TNGP04.phx.gbl. ..
                      Hi
                      >
                      I have searched for answer to this question on the net but surprisingly no
                      clear answer has come up. How can I open a form hidden in vb.net?
                      >
                      Thanks
                      >
                      Regards
                      >
                      >

                      Comment

                      • rowe_newsgroups

                        #12
                        Re: Opening a form hidden

                        Personally, I wouldn't look at much that was standard operating procedure in
                        VB 6.0 as a reason for doing it that way now. :)
                        You did read my earlier post right? I certainly don't advocate moving
                        the forms off screen to hide them (except in certain cases of mdi
                        children where nothing else will work), I was just sharing some
                        interesting information / history.

                        Thanks,

                        Seth Rowe [MVP]

                        Comment

                        • Scott M.

                          #13
                          Re: Opening a form hidden

                          >Read as well as you read the thread? After all you criticized my post
                          >without even taking the time to actually read what I wrote.....
                          >Thanks,
                          >Seth Rowe [MVP]
                          I did no such thing. I expressed my opinion about using VB 6 practices in
                          ..NET applications. I don't see what you think I didn't read. Your post was
                          short and quite clear.

                          -Scott

                          Comment

                          Working...