However, if I right click on the non-active form the focus and z-index does not change. In my program I have context menus for the forms; these context menus appear correctly, but again, the focus and z-index does not change.
I created a simple test program: a MDI parent form with the containing area and a button to create new forms. The new button does:
Expand|Select|Wrap|Line Numbers
- Form childForm = new Form();
- childForm.MdiParent = this;
- childForm.Show();
With this, the same issue arises. I can switch focus and z-index by left clicking between the child forms but I cannot switch by right clicking. I also checked the MDIChildActivate event. This event is fired when I left click, but not when I right click.
I checked Excel (2003) and right clicking does change the focus and z-index. So my assumption is that it is a bug. My hope is that I can find a workaround that doesn't involve adding code to everyone of my child forms.
I know that if .Show() is called on a child form (or any of its components) before its parent is set, a bug happens were the user can only switch between the child forms by clicking on their titlebars or form edges. I discovered this bug a while back, but did not realize that Right clicking had the same symptoms and was not corrected when I moved any .Show() events in the form to code after .MdiParent was set.
Would this question be more applicable in the c# forum? I'm not sure if this bug happens in Visual Basic or if its just c#.