all groups > dotnet windows forms > february 2008 >
You're in the

dotnet windows forms

group:

Opening a form hidden



Re: Opening a form hidden Martin Zugec
2/22/2008 2:01:39 PM
dotnet windows forms: 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,
Re: Opening a form hidden kimiraikkonen
2/22/2008 2:02:29 PM
[quoted text, click to view]

Use Me.Hide() into your form_load event. Or try to set form's
Re: Opening a form hidden kimiraikkonen
2/22/2008 2:03:49 PM
[quoted text, click to view]

Yes, setting visibility property to false might not work for some
Re: Opening a form hidden RobinS
2/22/2008 6:05:09 PM
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.
------------------------------
[quoted text, click to view]
Re: Opening a form hidden Jack Jackson
2/22/2008 9:10:11 PM
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>
[quoted text, click to view]
Opening a form hidden John
2/22/2008 9:39:50 PM
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 Herfried K. Wagner [MVP]
2/22/2008 10:49:44 PM
"John" <John@nospam.infovis.co.uk> schrieb:
[quoted text, click to view]

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 Herfried K. Wagner [MVP]
2/22/2008 11:14:54 PM
"kimiraikkonen" <kimiraikkonen85@gmail.com> schrieb:
[quoted text, click to view]

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 Armin Zingler
2/23/2008 12:10:39 AM
"kimiraikkonen" <kimiraikkonen85@gmail.com> schrieb
[quoted text, click to view]


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 Armin Zingler
2/23/2008 12:16:32 AM
[quoted text, click to view]

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 kimiraikkonen
2/23/2008 2:30:30 AM
[quoted text, click to view]

OK, in this case setting opacity to %0 seems really working way for
Re: Opening a form hidden RobinS
2/23/2008 9:12:32 PM
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.
-------------------------------------
[quoted text, click to view]
Re: Opening a form hidden rowe_newsgroups
2/25/2008 6:13:29 AM
[quoted text, click to view]

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,

Re: Opening a form hidden rowe_newsgroups
2/25/2008 6:15:13 AM
[quoted text, click to view]

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,

Re: Opening a form hidden Scott M.
2/26/2008 5:30:17 PM
This seems to scream "bad UI design"' to me.


[quoted text, click to view]

Re: Opening a form hidden Scott M.
2/26/2008 5:32:55 PM
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


[quoted text, click to view]

Re: Opening a form hidden rowe_newsgroups
2/26/2008 6:42:50 PM
[quoted text, click to view]

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,

Re: Opening a form hidden Scott M.
2/26/2008 9:55:34 PM

[quoted text, click to view]

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 rowe_newsgroups
2/27/2008 4:33:15 AM
[quoted text, click to view]

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,

Re: Opening a form hidden RobinS
3/1/2008 12:33:16 AM
Thanks! There's nothing like criticism without advice!

RobinS.
GoldMail, Inc.
-------------------
[quoted text, click to view]
Re: Opening a form hidden rowe_newsgroups
3/1/2008 4:57:16 PM
[quoted text, click to view]

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,

Re: Opening a form hidden Scott M.
3/1/2008 5:44:16 PM
I've already provided the advice if you took the time to read the rest of
the thread.


[quoted text, click to view]
Re: Opening a form hidden Scott M.
3/1/2008 11:46:04 PM
[quoted text, click to view]

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 RobinS
3/2/2008 11:44:37 PM
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.
-------------------------------
[quoted text, click to view]
Re: Opening a form hidden Scott M.
3/3/2008 6:04:48 PM
You not too bad for a laugh yourself, Robin!



[quoted text, click to view]

AddThis Social Bookmark Button