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

RadCheckBox focus by tab

1 Answer 175 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Kuba
Top achievements
Rank 1
Kuba asked on 11 Mar 2014, 11:02 AM
Hi.
I would like to achieve highlight of checkbox to be the same as mouse hover when I focus on checkbox with tab button. VisualStyleBuilder doesn't support this (or I just can't see this option). How can I achieve my goal?
Cheers,
Kuba.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Mar 2014, 07:53 AM
Hi Kuba,

Thank you for writing.

You cannot achieve you goal with Visual Style Builder, but you can change the style in code. For example you can subscribe to the GotFocus and LostFocus events and change the BackColor there:
void radCheckBox1_LostFocus(object sender, EventArgs e)
{
    radCheckBox1.ButtonElement.CheckMarkPrimitive.Fill.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
    radCheckBox1.ButtonElement.CheckMarkPrimitive.Fill.ResetValue(LightVisualElement.BackColor2Property, Telerik.WinControls.ValueResetFlags.Local);
}
 
void radCheckBox1_GotFocus(object sender, EventArgs e)
{
    radCheckBox1.ButtonElement.CheckMarkPrimitive.Fill.BackColor = Color.DarkGray;
    radCheckBox1.ButtonElement.CheckMarkPrimitive.Fill.BackColor2 = Color.Gray;
}

Let me know if you have additional questions.

Regards,
Dimitar
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Kuba
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or