Cassio Posted February 5, 2003 Posted February 5, 2003 How can I know if a MDI Child is already openned? I want the user to click an icon on the MDIParent menu and if the MDIChild is already openned it just get the focus instead of opening another MDIChild. Thanks. Quote Stream of Consciousness (My blog)
*Experts* Nerseus Posted February 5, 2003 *Experts* Posted February 5, 2003 There's no built in way to do this like there was in VB6 (or previous versions). You can define a form-level variable in your MDI parent form. When the user clicks the button, check if the variable is Nothing (or null in C#) then create the form and show it. If it's not Nothing, just show the form. There are other options, like using a static method of the child form to have IT control the one an only one instance. It's the same concept, but you'd call the static method of the child class which would instantiate a static variable (if not already Nothing or null) and show it. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Cassio Posted February 5, 2003 Author Posted February 5, 2003 Thanks Nerseus. I´m trying to do it, but i'm not getting it right. Could you give me a example? Im having problems when I close the MDIChild, i cant make it open again. Quote Stream of Consciousness (My blog)
Leaders John Posted February 5, 2003 Leaders Posted February 5, 2003 Try this: http://www.xtremedotnettalk.com/showthread.php?s=&postid=351637#post351637 Orbity Quote "These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Cassio Posted February 5, 2003 Author Posted February 5, 2003 Thanks! Thats what I needed. Quote Stream of Consciousness (My blog)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.