c# - Set focus to an mdi container after showing an mdi child -
I am trying to create a form of MDI container, and when I press a button on the numpad (1-9 ), A small form (which will be the MDI child of the form) will appear in the relative location for the position of the numbered (5 is in the middle, 9 is the top right), and then I want to concentrate on my MD Program to return to the container so that you can press the button again.
I have such a major event in my MDI container:
Private Zero MdiClient_KeyPress (Object Sender, KeyPressEventArgs e) {int num; If (E.Kerk> = '1' & amp; A.K.Kerk & lt; = '9') {num = E. Keker - '0'; PhysicalChild PC = New PhysicalChild (); Pc.MDIParent = this; Pc.Show (); Pc.Location = new point (number% 3 * width / 2 - 50 * number, number / 3 * height / 2 - 50 * digits); Pc Size = new size (50, 50); Focus (); }}
The problem is that the MDI does not return the focus to the container, even if I do not click the mouse on the container area, I have to close the MDI child for more button press received
Thank you
"text">
What I have read, when MDI child Forms, they always focus on MDI parents only take focus, when there is no child, who meditate Can Rit.
But, what I have read about the hair window, you can turn the parent's property into a taps on the child. This child is to be separated from the parents ... that should be in effect with your MDI window being re-useless. (Disclaimer: I did not really try to do this, so I do not know that this will solve your problem.)
If that does not work, then a MDI window is the best solution for you May not be the application. MDI windows are usually empty containers, in addition to the menus: they do not have their own content.
Comments
Post a Comment