Application.Run() [modified]
-
Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007
-
Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007
I'm almost 100% sure, that it is necessary. Your application needs to be executed somewhere in the code.
Virtual1ty
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
-
Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007
Hi, to have a live Windows app, showing Windows and reacting to the user, you need a "message pump", i.e. an event queue that collects GUI events, and a loop that reads from that queue and executes the messages. The normal way to achieve this is by calling Application.Run(); there may be other ways to achieve the same, but nothing as simple as the one line that does everything that is required. BTW: you don't need Application.Run() when you don't need the message pump, as in a Console app. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google
-
Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007
Question - why do you think it's there, if it's not necessary ? Why do you want to bypass it ?
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007
Thanks to all ... Really.. So now I get that the message pump that is required is provided by Application.Run(). Otherwise the application would die without any messages.. Thanks once again folks.