KlausW Posted July 17, 2009 Posted July 17, 2009 Hi community, i want to create simple MDI application but ths child forms should be in a special order of visibility (or layer). For example: if a child form has layer 0 it is always top most of all other child forms. A child form with layer 1 is behind a child form with layer 0 but in front of a childform with layer 2 and so on... Does anybody know a solution? Thanks Quote
joe_pool_is Posted August 14, 2009 Posted August 14, 2009 Sounds like you need to ditch the idea of an MDI application and create a form with multiple panels. Panels can have an order. Why do you need the MDI style if you are forcing forms to be in a specific order? That isn't what an MDI form is for. Quote Avoid Sears Home Improvement
bprashanth Posted August 14, 2009 Posted August 14, 2009 Your problem will be answered by something called Z-Order. The simplest - and easiest - solution would be just calling BringToFront() method in the order that you want the forms to be displayed. You may want to refer this link: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/2d59e858-5705-400b-a383-fd479e9409da Quote
Leaders snarfblam Posted August 14, 2009 Leaders Posted August 14, 2009 Keep in mind, reordering the forms every time they become out of order is going to produce flickering, and the active form will always try to force itself on top. Quote [sIGPIC]e[/sIGPIC]
bprashanth Posted August 16, 2009 Posted August 16, 2009 @marble_eater Yes, but to try to prevent form from being at the top we can always use the Form.Hide() method, right? Quote
joe_pool_is Posted August 16, 2009 Posted August 16, 2009 Isn't Hide() the same as Visible = false? (I don't use it, so I'm just asking) Quote Avoid Sears Home Improvement
bprashanth Posted August 17, 2009 Posted August 17, 2009 @joe_pool_is I think Hide is as same as Visible = False when you are using Form.Show() method. But in one particular scenario when I used Form.ShowDialog method, I had certain problems using Hide() method which were solved by using Visible=False. Quote
Administrators PlausiblyDamp Posted August 17, 2009 Administrators Posted August 17, 2009 If you look at the underlying IL for the .Hide() method it just calls .Visible = false anyway. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
joe_pool_is Posted August 17, 2009 Posted August 17, 2009 If you look at the underlying IL for the .Hide() method it just calls .Visible = false anyway.I suspected as much - I've just never taken the time to learn IL. Quote Avoid Sears Home Improvement
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.