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.

TabControlExt and child control focus in form load

Thread ID:





1337 Oct 18,2002 02:26 PM Oct 24,2002 09:36 AM Windows Forms 4
Tags: Tools
Hugues Valois
Asked On October 18, 2002 02:26 PM

I have a form with a TabControlExt on it, with 2 tabs. The first tab has a TextBox on it. In Form.Load I try to set the focus to the TextBox and select its text: textBox1.SelectAll(); textBox1.Focus(); I know there was a similar problem with the SelectedIndexChanged event that got fixed, but I need to do this in the form Load and it looks like whatever I do in form Load the focus always goes to the tab itself. thanks, hugues

Administrator [Syncfusion]
Replied On October 21, 2002 07:08 AM

The problem with doing this in Form_Load is quite probably because the Control is not Visible, yet. You could instead set the TabStop of the tab control to false, then after Form_Load the focus will be set on one of the children in the current tab page (based on TabOrder). Will that work? -Praveen

Hugues Valois
Replied On October 21, 2002 11:08 AM

Thanks for your response. Your suggestion does work, and I'll use that for now, but I'm concerned that I am preventing the user from using the keyboard to switch to other tabs. hugues

Administrator [Syncfusion]
Replied On October 23, 2002 09:14 AM

Hugues, Our tab control will still let the user to switch between tabs using Ctrl+Tab, etc. even when the focus is on one of the children within the tab (as long as the SwitchPagesForDialogKeys is set to true). Will that work for you? Regards, Praveen Ramesh

Hugues Valois
Replied On October 24, 2002 09:36 AM

Thanks, I didn't know about Ctrl-Tab, I'm happy with this solution now!


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.