Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Hide windows form onLoad

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leon - 25 Oct 2004 15:35 GMT
When i load up my application I want to Hide the start form and open up a
preview form,

Im trying with
private void Form1_Load(object sender, System.EventArgs e)
        {
            this.Hide();
                                               Form form2 = new Form2();
            form2.Show();
        }

but its not hiding the first form,
what am i doing wrong?

but
Shishir Kumar Mishra - 25 Oct 2004 16:13 GMT
Hi,
Any specific reason to load form1 first?  From application you can always
load your preview from first (Form2).
You can always creates instance of form1(main form) from preview and show it
after closing of form2.

Regards
Shishir Kumar Mishra
Manhattan Associates
> When i load up my application I want to Hide the start form and open up a
> preview form,
[quoted text clipped - 11 lines]
>
> but
Herfried K. Wagner [MVP] - 25 Oct 2004 16:26 GMT
"Leon" <Leon@discussions.microsoft.com> schrieb:
> When i load up my application I want to Hide the start form
> and open up a preview form,

In addition to the other reply:

> Im trying with
> private void Form1_Load(object sender, System.EventArgs e)
> {
> this.Hide();

Your form is not yet visible here!

>                                                 Form form2 = new Form2();
> form2.Show();

Your form will be visible here.  In order to prevent the form from becoming
visible, use 'ShowDialog' instead of 'Show' or take a look at the
'Application' and 'ApplicationContext' classes.

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/

Leon - 26 Oct 2004 07:23 GMT
I have an preview window and a edit window, what I want is that when I double
click a file it should open the preview mode, but otherwise if you start the
program manually it should open in edit mode, i then would like to have an
edit button in the preview form and a preview button in the edit form, so you
can jump between the two.

in the mainform:

if(args.Length != 0)
{
Application.Run(new Player(args[0]));
} else {
Application.Run(new Maker());
}

This works fine.. the problem is switching between the two forms...

Cheers

> When i load up my application I want to Hide the start form and open up a
> preview form,
[quoted text clipped - 11 lines]
>
> but

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.