Solved

Displaying a form when Main Form of the application is loaded

Posted on 2004-09-15
3
240 Views
Last Modified: 2010-08-05
Hi,

I need to show a preference form when the application is first launched. If I show the preferences form at the Form_Load event of the application main form, the main form is not displayed. I want that the main form is launched then the preferences form is displayed. Any suggestions?

Thanks, Nauman.
0
Comment
Question by:nauman_ahmed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

by:
s_sansanwal earned 250 total points
ID: 12070453
Open form in PAINT event and add a flag

            private bool loaded = false;
            private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
            {
                  if(loaded == false)
                  {
                        Form2 frm = new Form2();
                        frm.ShowDialog();
                        loaded = true;
                  }
            }

Hope this helps.

S Sansanwal
0
 
LVL 3

Assisted Solution

by:GrumbleBot
GrumbleBot earned 250 total points
ID: 12070760
In the constructor add this after InitializeComponent();

   this.Show(); //display the main form
   Form2 f = new Form2(); //Your preference form
   f.ShowDialog(); // then display your preference form

hope this helps
good luck

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question