![]() |
Making the form open once
What I want to do is to make it so that if the form is already opened, it shouln't open again until it is closed... also I don't want to use ShowDialog().
I tried this: :
frmSecondary frm = new frmSecondary();But I'm getting this error: :
Error 1 The event 'System.Windows.Forms.Form.Shown' can only appear on the left hand side of += or -= |
'Shown' is an event, not a boolean value. You might want to consider the 'Visible' property.
|
try something like this
:
also, i didnt compile the code, i just typed it out so let me know if it doesnt work right |
Of course it wont work 'right' - the condition will never result to true.
What I suggest you do is track the forms Load and Closing events, setting variables appropriately so that conditional statements have a non-futile use. |
Quote:
|
That one mistake could easily cause you headaches in the future - does you best to keep a sharp eye.
|
| All times are GMT -5. The time now is 2:32 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC