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. Image for the cookie policy date

Setting focus in TabbedMDI child window

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

6 Replies

AS Arun Srinivasan Syncfusion Team October 2, 2003 11:51 AM UTC

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


AS Arun Srinivasan Syncfusion Team October 2, 2003 06:21 PM UTC

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


AD Administrator Syncfusion Team October 3, 2003 12:03 PM UTC

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


AS Arun Srinivasan Syncfusion Team October 3, 2003 12:36 PM UTC

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


AD Administrator Syncfusion Team October 3, 2003 07:27 PM UTC

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


AS Arun Srinivasan Syncfusion Team October 6, 2003 07:06 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon