this.show() doesn't display controls.
-
I need to display form for 5 seconds. I have following code, this.show(); int ret1 = 0; int ret2 = 0; ret1 = Configure1(); ret2 = CreateLogin(); System.Threading.Thread.Sleep(5000); this.Close(); The form displays but it doesn't display the label on the form. Is there any other way to achieve the same?
-
I need to display form for 5 seconds. I have following code, this.show(); int ret1 = 0; int ret2 = 0; ret1 = Configure1(); ret2 = CreateLogin(); System.Threading.Thread.Sleep(5000); this.Close(); The form displays but it doesn't display the label on the form. Is there any other way to achieve the same?
harsha1305, Label?, What label. In the code you pasted you display something - guessing a form - and then get to int's, tell the thread to sleep and close the form. If you create the label in either Configure1(); or CreateLogin(); then you need to paste that code. Regards, Gareth.
-
harsha1305, Label?, What label. In the code you pasted you display something - guessing a form - and then get to int's, tell the thread to sleep and close the form. If you create the label in either Configure1(); or CreateLogin(); then you need to paste that code. Regards, Gareth.
-
you havent shown any code initializing a label. maybe you just need to call InitializeComponents()?
-
I need to display form for 5 seconds. I have following code, this.show(); int ret1 = 0; int ret2 = 0; ret1 = Configure1(); ret2 = CreateLogin(); System.Threading.Thread.Sleep(5000); this.Close(); The form displays but it doesn't display the label on the form. Is there any other way to achieve the same?
-
I need to display form for 5 seconds. I have following code, this.show(); int ret1 = 0; int ret2 = 0; ret1 = Configure1(); ret2 = CreateLogin(); System.Threading.Thread.Sleep(5000); this.Close(); The form displays but it doesn't display the label on the form. Is there any other way to achieve the same?
Hi, I strongly advise against it in general, but here is a good opportunity to use
Application.DoEvents();
just in front of the Sleep. However it is always better to use threading, since your Sleep will put the GUI interaction out of service for 5 seconds no matter what. :)Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
Um you can't use Show,Sleep, and finally close in sequence and expect to get any UI behavior. Use a Timer rather than sleep and put the close in the timer event handler.
led mike
-
Can you send me sample code for timer for 5 seconds? I just want it to display the form for 5 seconds before closing.
I don't want to offend you but if you plan on being a capable software developer you need to learn to read documentation and how to find things like that for yourself. It is very likely that the documentation for the Timer class on MSDN has example code.
led mike