![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Sep 2004
Posts: 47
Rep Power: 0
![]() |
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();
if (frm.Shown == false)
{
frm.Show();
}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 -= |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Feb 2006
Location: Columbus, OH
Posts: 84
Rep Power: 3
![]() |
'Shown' is an event, not a boolean value. You might want to consider the 'Visible' property.
|
|
|
|
|
|
#3 |
|
Expert Programmer
|
try something like this
csharp Syntax (Toggle Plain Text)
also, i didnt compile the code, i just typed it out so let me know if it doesnt work right
__________________
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
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.
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles.. |
|
|
|
|
|
#5 | |
|
Expert Programmer
|
Quote:
![]()
__________________
|
|
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
That one mistake could easily cause you headaches in the future - does you best to keep a sharp eye.
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles.. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FFT DWTIB -> Optimization -> Choosing An Appropriate Run Time | Sane | Software Design and Algorithms | 7 | Dec 1st, 2006 10:40 AM |
| Show or hiding forms/modifying control properties ..from different a form.. | cloud- | C# | 4 | Nov 10th, 2006 10:51 AM |
| OnlineTextEditor.Com! | Sane | Show Off Your Open Source Projects | 43 | Jun 16th, 2006 8:55 AM |
| .NET Timer Form closing issue | MBirchmeier | C# | 4 | Nov 21st, 2005 10:00 AM |
| Can't open a different form... | HappyTomato | C# | 2 | Jul 18th, 2005 8:03 AM |