- Where Developers Learn, Share, & Build Careers
How do you open an example form on a modal
path?
I tried this. ShowDialog ()
but this form does not appear modal (you can still use other forms). I think this is because it is in its original form, if it shows itself, but I'm not sure.
My problem:
I have an application of 2 forms:
-
mainform
-
LoginForm
MainForm
creates an example of LoginForm
to ask the user to authenticate And opens. There is a timer to check in regularly LoginForm
and log in to the user - I want to open this timer LoginForm
modally I know that this timer should be < Code> main form , but I would like to know how to create an example of a form ShowDialog ()
.
Thanks in advance.
Make sure that you ShowDialog
after initial element
:
public newForm () {InitializeComponent (); This. ShowDialog (); }
My Exams
I have Form2
:
public partial Category form 2: Form {public form 2 ()} // Public caller ShowModalForm () {InitializeComponent ();); ShowDialog (); }}
And without any parent start it on the main and it starts modally:
Fixed class program {[STAThread] static Zero Main () {New Form2 () ShowModalForm () .; // application. Aaron (new form 1 ()); }}
Comments
Post a Comment