This is a migrated thread and some comments may be shown as answers.

Focus on control when SelectedTab changed

1 Answer 138 Views
TabbedForm
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
Iron
n/a asked on 30 Apr 2020, 07:07 AM

Hi,

 

I'm trying to set the focus on the first control of my tab when user switches between tab. To do that, I'm using the eventhandler SelectedTabChanged and put something like that:

private void radTabbedFormControl1_SelectedTabChanged(object sender, EventArgs e)
{
    textBox8.Focus();
}

 

 

 

But unfortunately, I can see that my control take the focus but immediatly lose it after.

Can you tell me how I can achieve that ? The final goal is to restore the focus state when the user is switching between tab, so he don't have to do an useless click with mouse to continue to work.

Thanks

Best Regards

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 04 May 2020, 01:57 PM

Hello Eric,

In order to achieve this, you should set the TabbedFormControl.Focusable property to false. As you already noticed the textbox control receives the focus but then lose it immediately because the focus internally changes to another element:

this.TabbedFormControl.Focusable = false;

Please refer to the attached gif file that demonstrates the achieved result.

I hope this helps. Should you have other questions do not hesitate to ask.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
TabbedForm
Asked by
n/a
Top achievements
Rank 1
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or