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

RadButton with Circle Shape Border

1 Answer 399 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 23 Apr 2018, 02:49 PM

Hello,

I have a RadButton in a winform with a circle shape and an image.  

The border of the button works fine when there the mouse is over the button, but one clicked and the mouse leaves the control, the border size seems to change.

Please see the attached images.  The one "with mouse focus" was captured with a screen shot while the mouse was over the button, but the Windows screen grab does not show the mouse.  The "no mouse focus" image is after the button has been clicked and the mouse is no longer over the control.

I have not been able to locate where to change the border setting when the button has been clicked, but does not have mouse focus.

Any suggestions?

Thanks

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Apr 2018, 08:35 AM
Hello, Mike,   

There is a color applied to the ButtonElement.BorderElement.InnerColor which is illustrated in the attached screenshot. You can make it transparent and manipulate the ButtonElement.BorderElement.ForeColor when the control gets/looses focus. Here is a sample code snippet:
public RadForm1()
{
    InitializeComponent();
 
    this.radButton1.ButtonElement.Shape = new CircleShape();
 
    this.radButton1.GotFocus += radButton1_GotFocus;
    this.radButton1.LostFocus += radButton1_LostFocus;
 
    this.radButton1.ButtonElement.BorderElement.InnerColor = Color.Transparent;
}
 
private void radButton1_LostFocus(object sender, EventArgs e)
{
    this.radButton1.ButtonElement.BorderElement.ForeColor = defaultBoderColor;
}
 
Color defaultBoderColor = Color.Empty;
 
private void radButton1_GotFocus(object sender, EventArgs e)
{
    defaultBoderColor = this.radButton1.ButtonElement.BorderElement.ForeColor;
    this.radButton1.ButtonElement.BorderElement.ForeColor = Color.FromArgb(255, 144, 0);
}



I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
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
Mike
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or