473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Right Clicking a MDI child form does not change the focus to the form

My main program is a Multiple Document Interface (MDI). I create and show 2 or more child forms inside the MDI parent. If I left click on the child forms, the focus and Z-index will change correctly. (E.G. I have form1 and form2 as the child forms, form1 is active. I left click anywhere on form2 and the focus and z-index changes). This works correctly.

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
  1. Form childForm = new Form(); 
  2. childForm.MdiParent = this; 
  3. childForm.Show();
  4.  

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#.
Aug 5 '10 #1
1 1749
Was anyone able to duplicate this bug?
Aug 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Brian | last post by:
I'm trying unsuccessfully to use a variable in a script that changes focus. Depending on which link a user follows (navigates via keyboard or clicks), I'd like to change the focus to an input...
4
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see...
6
by: Chris Thunell | last post by:
Right now I have a vb.net windows form project that does a whole bunch of things on the form.load event. The problem with this is that the user does not see the form until all the those things are...
5
by: Petec | last post by:
Is there a way to prevent a form from getting focus? Thanks! - Pete
1
by: DomGo | last post by:
Hi, I try to open a form, that automatically loses focus to the window, that had the focus immediatly before the new form has been opened. The new form is topmost and displays a message only for...
13
by: M O J O | last post by:
Hi, I need to create a popup form what will not steal focus. I've searched the net and I managed to put some code together. Below is the result of my code, but I have a single question .......
2
by: Susan Sullivan | last post by:
How can I change properties of a child form through a parent form? I have a child form with a rich text box. I want to control font properties of the rich text box through a menu on the parent...
3
by: Ricardo Maciel | last post by:
The How to page: http://msdn2.microsoft.com/en-us/library/7aw8zc76(VS.80).aspx walks through the creation of MDI child forms. It includes instructions to set the property MdiList to maintain a...
4
by: Jon Slaughter | last post by:
I've created some custom controls and forms that allow the feature to temporarily transfer focus to a control that has been entered by the mouse. Everything seems to work fine but the problem I...
3
by: chuck gregory | last post by:
I'm using the 2002 (10.6771.6845) SP3 Access program. I have a form that will not show previously entered data. It has about 45 fields. I will call it the "parent" form. The "parent" form was at...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.