Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
GeneralRe: FlowLayourPanel only removes visible control? Pin
Luc Pattyn7-Oct-10 16:53
sitebuilderLuc Pattyn7-Oct-10 16:53 
GeneralRe: FlowLayourPanel only removes visible control? Pin
Charles Cox7-Oct-10 17:03
Charles Cox7-Oct-10 17:03 
GeneralRe: FlowLayourPanel only removes visible control? Pin
Luc Pattyn7-Oct-10 17:16
sitebuilderLuc Pattyn7-Oct-10 17:16 
GeneralRe: FlowLayourPanel only removes visible control? Pin
Charles Cox7-Oct-10 17:24
Charles Cox7-Oct-10 17:24 
GeneralRe: FlowLayourPanel only removes visible control? Pin
Luc Pattyn7-Oct-10 17:29
sitebuilderLuc Pattyn7-Oct-10 17:29 
GeneralRe: FlowLayourPanel only removes visible control? Pin
Charles Cox7-Oct-10 17:33
Charles Cox7-Oct-10 17:33 
GeneralRe: FlowLayourPanel only removes visible control? Pin
Luc Pattyn7-Oct-10 17:36
sitebuilderLuc Pattyn7-Oct-10 17:36 
QuestionHow to present an openning screen (form) in C# application? Pin
Shultz 27-Oct-10 9:23
Shultz 27-Oct-10 9:23 
Hi all
I have a rather big GUI application in C# (.NET 2.0, VS2005), which takes some time when first started (its IinitializeComponent method, along with some other setup actions I am doing takes about 4-7 seconds).

I want to present the user an 'Opening screen' that will be presented while the application gets loaded, and once it finishes, this 'Openning screen' will be vanished.

I have tried to 'show' the 'Openning screen' form before starting my applic, but it fails to be drawn completely and fails to shut off when my app finished its setup (since the main thread can't reach its close statement as it stays on the message loop of my main app).
Here is some pseudo code:

[STAThread]
static void Main(
{            
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

OpenScreenForm op = new OpenScreenForm();
op.show();

// setup my main up
MainApp m = new mainaApp()); // time consuming operations...   

Application.Run(m);       

op.Close(); // this statement is never reached !!!
}


I have tried using other thread to show the openning screen, and joins him (by the main thread), so that I could make sure that the form finished its showing stuff, but this also failed (openning screen gets shown for a glimpse and hides back..)
Here is some pseudo code:

[STAThread]
static void Main(
{            
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

Thread openThread = new Thread(new ThreadStart(CreateOpenningForm));
openThread.Start();
openThread.Join();

// setup my main up
MainApp m = new mainaApp());        // time consuming operations...

op.Close(); // cross thread exception here !!!

Application.Run(m);       
}
...
static void CreateOpenningForm()
{
op = new OpenScreenForm();
op.Show();
}


Does any one has any idea how to accomplish that ?
Thanks in advance
AnswerRe: How to present an openning screen (form) in C# application? Pin
Ian Shlasko7-Oct-10 9:40
Ian Shlasko7-Oct-10 9:40 
GeneralRe: How to present an openning screen (form) in C# application? Pin
Luc Pattyn7-Oct-10 9:59
sitebuilderLuc Pattyn7-Oct-10 9:59 
GeneralRe: How to present an openning screen (form) in C# application? Pin
Shultz 27-Oct-10 10:55
Shultz 27-Oct-10 10:55 
GeneralRe: How to present an openning screen (form) in C# application? Pin
Luc Pattyn7-Oct-10 11:01
sitebuilderLuc Pattyn7-Oct-10 11:01 
GeneralRe: How to present an openning screen (form) in C# application? Pin
Shultz 27-Oct-10 13:07
Shultz 27-Oct-10 13:07 
GeneralRe: How to present an openning screen (form) in C# application? Pin
Luc Pattyn7-Oct-10 13:24
sitebuilderLuc Pattyn7-Oct-10 13:24 
AnswerRe: How to present an openning screen (form) in C# application? Pin
#realJSOP7-Oct-10 23:39
professional#realJSOP7-Oct-10 23:39 
QuestionAdd in module Pin
Wamuti7-Oct-10 6:28
Wamuti7-Oct-10 6:28 
AnswerRe: Add in module Pin
Nish Nishant7-Oct-10 8:19
sitebuilderNish Nishant7-Oct-10 8:19 
AnswerRe: Add in module Pin
Kelvin Armstrong7-Oct-10 11:03
Kelvin Armstrong7-Oct-10 11:03 
AnswerRe: Add in module Pin
Chris Trelawny-Ross7-Oct-10 11:33
Chris Trelawny-Ross7-Oct-10 11:33 
AnswerRe: Add in module Pin
PIEBALDconsult7-Oct-10 18:40
mvePIEBALDconsult7-Oct-10 18:40 
QuestionNeed help with my very first c# application Pin
turbosupramk37-Oct-10 5:14
turbosupramk37-Oct-10 5:14 
AnswerRe: Need help with my very first c# application Pin
S Houghtelin7-Oct-10 7:43
professionalS Houghtelin7-Oct-10 7:43 
GeneralRe: Need help with my very first c# application Pin
turbosupramk37-Oct-10 7:53
turbosupramk37-Oct-10 7:53 
AnswerRe: Need help with my very first c# application Pin
Luc Pattyn7-Oct-10 8:04
sitebuilderLuc Pattyn7-Oct-10 8:04 
GeneralRe: Need help with my very first c# application Pin
turbosupramk37-Oct-10 8:12
turbosupramk37-Oct-10 8:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.