We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Setting focus in TabbedMDI child window

Thread ID:

Created:

Updated:

Platform:

Replies:

7590 Oct 1,2003 01:51 PM Oct 6,2003 03:06 PM Windows Forms 6
loading
Tags: Tools
Administrator [Syncfusion]
Asked On October 1, 2003 01:51 PM

hi, I am using TabbedMDI with child windows contianing user controls with tabs in them. I want to focus the first textfield in the first tab when the child window is opened. I tried setting the focus in FormLoad event. It does not seem to work. I modified and attached the TabbedMDI sample, by adding a tab control to the child window and then adding a text box to the first tab. When the child form is opened, I want the focus to be in this textbox. How can I get it to work? thanks, - Reddy

Arun Srinivasan [Syncfusion]
Replied On October 2, 2003 07:51 AM

Hi Reddy, We are looking into this issue and we will update this posting soon. Thanks for your patience Arun

Arun Srinivasan [Syncfusion]
Replied On October 2, 2003 02:21 PM

Hi Reddy, This issue has been fixed internally and will be part of the next build. In the meantime you can work around this by calling the following line after loading your child form: this.mdiClient1.SelectNextControl(null, true, true, true, false); This will move the focus to the expected child control in the tab page. Thanks Arun

Administrator [Syncfusion]
Replied On October 3, 2003 08:03 AM

Arun, I tried your code in the sample I attached earlier. It does not work. Where exactly in my sample are you adding this code? thanks, - Reddy

Arun Srinivasan [Syncfusion]
Replied On October 3, 2003 08:36 AM

Hi Reddy I am uploading the modified sample that takes care your problem. The following line was added to MainForm_Load(): this.mdiClient1.SelectNextControl(null, true, true, true, false); Thanks Arun

Administrator [Syncfusion]
Replied On October 3, 2003 03:27 PM

Arun, Your code fixes the problem when the main form is initially created. If I create a new document using File->New Document1, it sets the focus on Document 4/tab control, not in textbox. Please let me know how to fix this. thanks, - Reddy

Arun Srinivasan [Syncfusion]
Replied On October 6, 2003 03:06 PM

Hi Reddy, Yes you are correct. Here is what you need to take care of this issue: In addDoc1_Click() you need to add: doc.SelectNextControl(null, true, true, true, false); right after: AddDocument(doc); Regards, Arun

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;