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

RadCheckbox focus border

3 Answers 319 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Bao
Top achievements
Rank 1
Bao asked on 04 Jan 2018, 01:07 AM

HI,

I have a problem when i focus. If i tab to checkbox it has the border highlight around the text . It is fine. But when i set it focused when open form. It does not display border like when i tab to radcheckbox. How can i display the focused border when open form ???

 

Thanks.

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 04 Jan 2018, 07:11 AM
Hi Bao,

This is controlled by the .NET framework and there is no way to manually show this border. You can check this with the standard checkbox as well. What you can do is manually change the border when the control gains or loses the focus:
public RadForm1()
{
    InitializeComponent();
 
    radCheckBox1.GotFocus += RadCheckBox1_GotFocus;
    radCheckBox1.LostFocus += RadCheckBox1_LostFocus;
}
 
private void RadCheckBox1_LostFocus(object sender, EventArgs e)
{
    radCheckBox1.ButtonElement.BorderElement.ShouldPaint = false;
}
 
private void RadCheckBox1_GotFocus(object sender, EventArgs e)
{
 
    radCheckBox1.ButtonElement.BorderElement.ShouldPaint = true;
    radCheckBox1.ButtonElement.BorderElement.ForeColor = Color.Red;
    radCheckBox1.ButtonElement.BorderElement.Width = 2;
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Bao
Top achievements
Rank 1
answered on 04 Jan 2018, 01:55 PM

Thank Dimitar,

So between set focus for checkbox and tab to checkbox. It is different ?

0
Dimitar
Telerik team
answered on 05 Jan 2018, 11:20 AM
Hello Bao,

Yes, the focus border is controlled by the OS and cannot be shown with code. 

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Bao
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Bao
Top achievements
Rank 1
Share this question
or