Multiple Forms Open --- Toolstrip
-
hi i had a problem while using toolstrip, in C# application i have a form named 'master', which is mdi child form. i access it from menu click event of mdiparent form. i have another form 'example'. it contains toolstrip. one of the toolstrip buttons is 'master' in 'example' form. now i m clicking that master toolstrip button again n again,it opens the 'master' form multiple times. how can i avoid this problem( multiple forms opening)? hope u help me in this issue. thanx in advance, nagendra kumar.
-
hi i had a problem while using toolstrip, in C# application i have a form named 'master', which is mdi child form. i access it from menu click event of mdiparent form. i have another form 'example'. it contains toolstrip. one of the toolstrip buttons is 'master' in 'example' form. now i m clicking that master toolstrip button again n again,it opens the 'master' form multiple times. how can i avoid this problem( multiple forms opening)? hope u help me in this issue. thanx in advance, nagendra kumar.
you could try keeping a reference to the master form somewhere, then you can check that to see if the form is already open or not. perhaps a static instance of the master form, then when you click button check if is null and create new one if it is
Life goes very fast. Tomorrow, today is already yesterday.
-
you could try keeping a reference to the master form somewhere, then you can check that to see if the form is already open or not. perhaps a static instance of the master form, then when you click button check if is null and create new one if it is
Life goes very fast. Tomorrow, today is already yesterday.
thanx musefan but i got a prob with that one is there any other way to solve it?
-
you could try keeping a reference to the master form somewhere, then you can check that to see if the form is already open or not. perhaps a static instance of the master form, then when you click button check if is null and create new one if it is
Life goes very fast. Tomorrow, today is already yesterday.
Is there a reason for suggesting static? I don't see how that would help, it would be better for the caller to hold a reference that is created when null.
Panic, Chaos, Destruction. My work here is done.
-
hi i had a problem while using toolstrip, in C# application i have a form named 'master', which is mdi child form. i access it from menu click event of mdiparent form. i have another form 'example'. it contains toolstrip. one of the toolstrip buttons is 'master' in 'example' form. now i m clicking that master toolstrip button again n again,it opens the 'master' form multiple times. how can i avoid this problem( multiple forms opening)? hope u help me in this issue. thanx in advance, nagendra kumar.
You can always use the MdiChildren property on your MDI Parent to identify whether or not the relevant form was open. There's no need to create a new property when MS has provided one for you.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Is there a reason for suggesting static? I don't see how that would help, it would be better for the caller to hold a reference that is created when null.
Panic, Chaos, Destruction. My work here is done.