RadCheckbox focus border

4 posts, 0 answers
  1. Bao
    Bao avatar
    52 posts
    Member since:
    Jan 2015

    Posted 03 Jan Link to this post

    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.

  2. Dimitar
    Admin
    Dimitar avatar
    2246 posts

    Posted 04 Jan Link to this post

    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.
  3. Bao
    Bao avatar
    52 posts
    Member since:
    Jan 2015

    Posted 04 Jan in reply to Dimitar Link to this post

    Thank Dimitar,

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

  4. Dimitar
    Admin
    Dimitar avatar
    2246 posts

    Posted 05 Jan Link to this post

    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.
Back to Top