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

Re: Opening a form hidden by Herfried

Herfried
Fri Feb 22 15:49:44 CST 2008

"John" <John@nospam.infovis.co.uk> schrieb:
> 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?

Simply do not call the form's 'Show' or 'ShowDialog' method and do not set
its 'Visible' property to 'True'. You can use the form object by
instantiating the form class:

\\\
Dim f As New FooForm()
...
///

The form remains invisible until you show it.

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


Re: Opening a form hidden by Martin

Martin
Fri Feb 22 16:01:39 CST 2008

I think he means main form (initial one)... It is not easy, because
setting Invisible=True is not working here...

There is official article at MSDN named "Setting a Form to Be
Invisible at Its Inception", but I found easier solution to set
opacity to 0% in designer and then just change it to 100% - effect is
same, but it is easier to implement. Only problem could be if you want
your application to run on older 9x clients - as far as I remember,
opacity is supported from Windows 2000.

Re: Opening a form hidden by kimiraikkonen

kimiraikkonen
Fri Feb 22 16:02:29 CST 2008

On Feb 22, 11:39=A0pm, "John" <J...@nospam.infovis.co.uk> wrote:
> 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.

Re: Opening a form hidden by kimiraikkonen

kimiraikkonen
Fri Feb 22 16:03:49 CST 2008

On Feb 23, 12:01=A0am, Martin Zugec <martin.zu...@gmail.com> wrote:
> I think he means main form (initial one)... It is not easy, because
> setting Invisible=3DTrue is not working here...
>
> There is official article at MSDN named "Setting a Form to Be
> Invisible at Its Inception", but I found easier solution to set
> opacity to 0% in designer and then just change it to 100% - effect is
> same, but it is easier to implement. Only problem could be if you want
> your application to run on older 9x clients - as far as I remember,
> opacity is supported from Windows 2000.

Yes, setting visibility property to false might not work for some
reason (?), then setting opacity value to %0 seems a good alternative.

Re: Opening a form hidden by Herfried

Herfried
Fri Feb 22 16:14:54 CST 2008

"kimiraikkonen" <kimiraikkonen85@gmail.com> schrieb:
>> 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/>


Re: Opening a form hidden by Armin

Armin
Fri Feb 22 17:10:39 CST 2008

"kimiraikkonen" <kimiraikkonen85@gmail.com> schrieb
> >
> > 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


Re: Opening a form hidden by Armin

Armin
Fri Feb 22 17:16:32 CST 2008

> "kimiraikkonen" <kimiraikkonen85@gmail.com> schrieb
> On Feb 23, 12:01 am, Martin Zugec <martin.zu...@gmail.com> wrote:
> > I think he means main form (initial one)... It is not easy,
> > because setting Invisible=True is not working here...
> >
> > There is official article at MSDN named "Setting a Form to Be
> > Invisible at Its Inception", but I found easier solution to set
> > opacity to 0% in designer and then just change it to 100% - effect
> > is same, but it is easier to implement. Only problem could be if
> > you want your application to run on older 9x clients - as far as I
> > remember, opacity is supported from Windows 2000.
>
> Yes, setting visibility property to false might not work for some
> reason (?), then setting opacity value to %0 seems a good
> alternative.

A Form is a visual element in order to display something or accept
input. Showing an invisible thing is a contradiction in itself.

If the problem is the application framework that only allows a Form as
the startup object, disable it and write your own sub Main to get full
control over your own application. Then you can show the Form only if it
has to be shown.


Armin


Re: Opening a form hidden by RobinS

RobinS
Fri Feb 22 20:05:12 CST 2008

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.infovis.co.uk> wrote in message
news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>
>


Re: Opening a form hidden by Jack

Jack
Fri Feb 22 23:10:11 CST 2008

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@imnottelling.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.infovis.co.uk> wrote in message
>news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>>
>>

Re: Opening a form hidden by kimiraikkonen

kimiraikkonen
Sat Feb 23 04:30:30 CST 2008

On Feb 23, 1:10=A0am, "Armin Zingler" <az.nos...@freenet.de> wrote:
> "kimiraikkonen" <kimiraikkone...@gmail.com> schrieb
>
>
>
> > > 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.

Re: Opening a form hidden by RobinS

RobinS
Sat Feb 23 23:12:36 CST 2008

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@cinnovations.net> wrote in message
news:jjavr3hh8js2qat0f4bdjhlc25qr09ml1c@4ax.com...
> 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@imnottelling.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.infovis.co.uk> wrote in message
>>news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>>>
>>>


Re: Opening a form hidden by rowe_newsgroups

rowe_newsgroups
Mon Feb 25 08:13:29 CST 2008

On Feb 23, 12:10 am, Jack Jackson <jjack...@cinnovations.net> wrote:
> 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...@imnottelling.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.infovis.co.uk> wrote in message
> >news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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]

Re: Opening a form hidden by rowe_newsgroups

rowe_newsgroups
Mon Feb 25 08:15:13 CST 2008

> 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]

Re: Opening a form hidden by Scott

Scott
Tue Feb 26 16:30:17 CST 2008

This seems to scream "bad UI design"' to me.


"RobinS" <robins@imnottelling.com> wrote in message
news:qsydnUV2jorE4iLanZ2dnUVZ_oOnnZ2d@comcast.com...
> 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.infovis.co.uk> wrote in message
> news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>>
>>
>



Re: Opening a form hidden by Scott

Scott
Tue Feb 26 16:32:55 CST 2008

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.infovis.co.uk> wrote in message
news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>
>



Re: Opening a form hidden by rowe_newsgroups

rowe_newsgroups
Tue Feb 26 20:42:50 CST 2008

On Feb 26, 5:32=A0pm, "Scott M." <s...@nospam.nospam> wrote:
> Armin's got the right idea here....
>
> Instead of playing tricks with the form (opacity, visibility, position,
> etc.). =A0Just take control of your application by using a Sub Main and th=
en
> you can launch the form whenever you need it.
>
> While there are other *solutions*, they all scream of "hack".
>
> -Scott
>
> "John" <J...@nospam.infovis.co.uk> wrote in message
>
> news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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- Hide quoted text -
>
> - Show quoted text -

Actually, moving the form offscreen has been recommended my the .NET
dev team for preventing flicker and drawing errors for MDI child
forms. Also, in more classic programming, moving forms and panels
offscreen was the recommended approach (take a look at how the VB6
wizard handles panels). Not saying they aren't "hacks", just sharing
some interesting tidbits. :-)

Thanks,

Seth Rowe [MVP]

Re: Opening a form hidden by Scott

Scott
Tue Feb 26 20:55:34 CST 2008


>Actually, moving the form offscreen has been recommended my the .NET
>dev team for preventing flicker and drawing errors for MDI child
>forms. Also, in more classic programming, moving forms and panels
>offscreen was the recommended approach (take a look at how the VB6
>wizard handles panels). Not saying they aren't "hacks", just sharing
>some interesting tidbits. :-)

>Thanks,

>Seth Rowe [MVP]

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. :)


Re: Opening a form hidden by rowe_newsgroups

rowe_newsgroups
Wed Feb 27 06:33:15 CST 2008

> 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]

Re: Opening a form hidden by RobinS

RobinS
Sat Mar 01 02:33:28 CST 2008

Thanks! There's nothing like criticism without advice!

RobinS.
GoldMail, Inc.
-------------------
"Scott M." <smar@nospam.nospam> wrote in message
news:%23klM0bMeIHA.3756@TK2MSFTNGP06.phx.gbl...
> This seems to scream "bad UI design"' to me.
>
>
> "RobinS" <robins@imnottelling.com> wrote in message
> news:qsydnUV2jorE4iLanZ2dnUVZ_oOnnZ2d@comcast.com...
>> 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.infovis.co.uk> wrote in message
>> news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>>>
>>>
>>
>
>


Re: Opening a form hidden by Scott

Scott
Sat Mar 01 16:44:16 CST 2008

I've already provided the advice if you took the time to read the rest of
the thread.


"RobinS" <robins@imnottelling.com> wrote in message
news:rK-dnfCV0ZRFiVTanZ2dnUVZ_hCdnZ2d@comcast.com...
> Thanks! There's nothing like criticism without advice!
>
> RobinS.
> GoldMail, Inc.
> -------------------
> "Scott M." <smar@nospam.nospam> wrote in message
> news:%23klM0bMeIHA.3756@TK2MSFTNGP06.phx.gbl...
>> This seems to scream "bad UI design"' to me.
>>
>>
>> "RobinS" <robins@imnottelling.com> wrote in message
>> news:qsydnUV2jorE4iLanZ2dnUVZ_oOnnZ2d@comcast.com...
>>> 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.infovis.co.uk> wrote in message
>>> news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>>>>
>>>>
>>>
>>
>>
>


Re: Opening a form hidden by rowe_newsgroups

rowe_newsgroups
Sat Mar 01 18:57:16 CST 2008

On Mar 1, 5:44=A0pm, "Scott M." <s...@nospam.nospam> wrote:
> I've already provided the advice if you took the time to read the rest of
> the thread.
>
> "RobinS" <rob...@imnottelling.com> wrote in message
>
> news:rK-dnfCV0ZRFiVTanZ2dnUVZ_hCdnZ2d@comcast.com...
>
>
>
> > Thanks! There's nothing like criticism without advice!
>
> > RobinS.
> > GoldMail, Inc.
> > -------------------
> > "Scott M." <s...@nospam.nospam> wrote in message
> >news:%23klM0bMeIHA.3756@TK2MSFTNGP06.phx.gbl...
> >> This seems to scream "bad UI design"' to me.
>
> >> "RobinS" <rob...@imnottelling.com> wrote in message
> >>news:qsydnUV2jorE4iLanZ2dnUVZ_oOnnZ2d@comcast.com...
> >>> 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... =A0;=
-)
>
> >>> RobinS.
> >>> GoldMail, Inc.
> >>> ------------------------------
> >>> "John" <J...@nospam.infovis.co.uk> wrote in message
> >>>news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.phx.gbl...
> >>>> Hi
>
> >>>> I have searched for answer to this question on the net but surprising=
ly
> >>>> no clear answer has come up. How can I open a form hidden in vb.net?
>
> >>>> Thanks
>
> >>>> Regards- Hide quoted text -
>
> - Show quoted text -

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]

Re: Opening a form hidden by Scott

Scott
Sat Mar 01 22:46:04 CST 2008

>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


Re: Opening a form hidden by RobinS

RobinS
Mon Mar 03 01:44:48 CST 2008

Of course I did, but in chronological order. Had this post said "keep
reading for some advice", I wouldn't have posted a response.

You're pretty entertaining.

RobinS.
GoldMail, Inc.
-------------------------------
"Scott M." <smar@nospam.nospam> wrote in message
news:0D79B960-2877-4D82-B133-4B090E1A9BEA@microsoft.com...
> I've already provided the advice if you took the time to read the rest of
> the thread.
>
>
> "RobinS" <robins@imnottelling.com> wrote in message
> news:rK-dnfCV0ZRFiVTanZ2dnUVZ_hCdnZ2d@comcast.com...
>> Thanks! There's nothing like criticism without advice!
>>
>> RobinS.
>> GoldMail, Inc.
>> -------------------
>> "Scott M." <smar@nospam.nospam> wrote in message
>> news:%23klM0bMeIHA.3756@TK2MSFTNGP06.phx.gbl...
>>> This seems to scream "bad UI design"' to me.
>>>
>>>
>>> "RobinS" <robins@imnottelling.com> wrote in message
>>> news:qsydnUV2jorE4iLanZ2dnUVZ_oOnnZ2d@comcast.com...
>>>> 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.infovis.co.uk> wrote in message
>>>> news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>


Re: Opening a form hidden by Scott

Scott
Mon Mar 03 17:04:48 CST 2008

You not too bad for a laugh yourself, Robin!



"RobinS" <robins@imnottelling.com> wrote in message
news:at-dnWVUs47tMVbanZ2dnUVZ_vWtnZ2d@comcast.com...
> Of course I did, but in chronological order. Had this post said "keep
> reading for some advice", I wouldn't have posted a response.
>
> You're pretty entertaining.
>
> RobinS.
> GoldMail, Inc.
> -------------------------------
> "Scott M." <smar@nospam.nospam> wrote in message
> news:0D79B960-2877-4D82-B133-4B090E1A9BEA@microsoft.com...
>> I've already provided the advice if you took the time to read the rest of
>> the thread.
>>
>>
>> "RobinS" <robins@imnottelling.com> wrote in message
>> news:rK-dnfCV0ZRFiVTanZ2dnUVZ_hCdnZ2d@comcast.com...
>>> Thanks! There's nothing like criticism without advice!
>>>
>>> RobinS.
>>> GoldMail, Inc.
>>> -------------------
>>> "Scott M." <smar@nospam.nospam> wrote in message
>>> news:%23klM0bMeIHA.3756@TK2MSFTNGP06.phx.gbl...
>>>> This seems to scream "bad UI design"' to me.
>>>>
>>>>
>>>> "RobinS" <robins@imnottelling.com> wrote in message
>>>> news:qsydnUV2jorE4iLanZ2dnUVZ_oOnnZ2d@comcast.com...
>>>>> 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.infovis.co.uk> wrote in message
>>>>> news:%23GaxxtZdIHA.1184@TK2MSFTNGP04.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
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>