473,698 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Control Focus with MDI Child Windows

Hello,
I have noticed that when switch between MDI children the focus is changed
from the control with the focus when last deactivate to the control with the
TabOrder of 1. Is there an automatic way to ensure that the focus is
returned to the control that previously had the focus when switching between
MDI children?

Thanks,
Dan
Nov 20 '05 #1
2 1877
"solex" <so***@nowhere. com> schrieb
Hello,
I have noticed that when switch between MDI children the focus is
changed from the control with the focus when last deactivate to the
control with the TabOrder of 1. Is there an automatic way to ensure
that the focus is returned to the control that previously had the
focus when switching between MDI children?


I also read the same question from you two days ago, but I didn't and don't
have an explanation. I tried to reproduce the problem, but I couldn't. The
focus stays at the same control.

Could you please handle the Enter (or gotfocus) event of the control that
gets focused when switched back to the form? Set a breakpoint there and have
a look at the callstack. Expand the "not user code" (roughly translated from
German) by right-clicking in the callstack window and select "view not user
code". Then post the complete callstack here.
--
Armin

Nov 20 '05 #2
Armin,

Thank you for responding. I should also note that the mdi children are
identical and have 3 user controls that I have created (which may be part of
the problem). I will look at the call stack.

Thanks,
Dan
"Armin Zingler" <az*******@free net.de> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
"solex" <so***@nowhere. com> schrieb
Hello,
I have noticed that when switch between MDI children the focus is
changed from the control with the focus when last deactivate to the
control with the TabOrder of 1. Is there an automatic way to ensure
that the focus is returned to the control that previously had the
focus when switching between MDI children?
I also read the same question from you two days ago, but I didn't and

don't have an explanation. I tried to reproduce the problem, but I couldn't. The
focus stays at the same control.

Could you please handle the Enter (or gotfocus) event of the control that
gets focused when switched back to the form? Set a breakpoint there and have a look at the callstack. Expand the "not user code" (roughly translated from German) by right-clicking in the callstack window and select "view not user code". Then post the complete callstack here.
--
Armin

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2318
by: Mike L | last post by:
I have a child form frmDataEntry call up another child form frmDealerSearch. If the user clicks on cancel on frmDealerSearch, I want to close frmDealerSearch and put the focus on txtDealerNum on frmDataEntry. Here is my code. public class frmDataEntry : System.Windows.Forms.Form { private void txtDealerNum_Leave(object sender, System.EventArgs e) {
0
829
by: solex | last post by:
Hello, I have noticed that when switch between MDI children the focus is changed from the control with the focus when last deactivate to the control with the TabOrder of 1. Is there an automatic way to ensure that the focus is returned to the control that previously had the focus when switching between MDI children? Thanks, Dan
0
1305
by: Qwert | last post by:
Heya, I have a user control (inherits from listview control). I add a textbox control to it as a child control and give the child control the focus. All is well when I type text (keyboard input) but when I click on the child control for the first time, the click event of the parent control is triggered and the parent control gets the focus. When I click again on the child control, the child control's event is triggered and it gets the...
1
5135
by: clickon | last post by:
For testing purposes i have got a 2 step WizardControl. Eqach step contains a text box, TextBox1 and TextBox2 respectively. If i put the following code in the respective activate event handlers for the two steps, TextBox1.Text ="foo"; and TextBox2.Text = "bar";
4
4301
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 have is that sometimes I seem to loose the original "holder" of focus and when the user hits tab while using "temporary" focus(while the mouse is over a control) it will change focus to the next control but not update it. So I have several issues....
5
7793
by: Senger | last post by:
Hi There! I need change the state of a checkboxbutton of a list of buttons. I use the folowing code to create buttons: for (z=1; z<=10; z++) { string booth = "boo" + (z+t).ToString(); CheckBox MiControl = new CheckBox();
9
18016
by: Zytan | last post by:
http://msdn2.microsoft.com/en-us/system.windows.forms.control.focus(VS.80).aspx this page says: "Focus is a low-level method intended primarily for custom control authors. Instead, application programmers should use the Select method or the ActiveControl property for child controls, or the Activate method for forms." I am trying to give a Numeric UpDown control focus. Only Focus() works. But this says to not use it.
7
14629
by: Andrus | last post by:
I have UserControls in MDI child forms containing TextBoxes and other controls. When user re-activates form, I need that Control which was last activated is activated again. Currently *first* control is activated always. To reproduce: 1. Run code. 2. Make TextBox2 as current TextBox by selecting its text
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.