?
Solved

Displaying a form when Main Form of the application is loaded

Posted on 2004-09-15
3
Medium Priority
?
241 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 1000 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 1000 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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

765 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