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

TabControlExt and child control focus in form load

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

4 Replies

AD Administrator Syncfusion Team October 21, 2002 11:08 AM UTC

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


HV Hugues Valois October 21, 2002 03:08 PM UTC

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


AD Administrator Syncfusion Team October 23, 2002 01:14 PM UTC

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


HV Hugues Valois October 24, 2002 01:36 PM UTC

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

Loader.
Up arrow icon