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

Highlight split button on focused

1 Answer 104 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 22 Sep 2011, 04:31 PM
How can I highlight RadSplitButton to make it more visible  when focused. I tried setting up explicitly IsMouseOver = true on focus enter event, but it doesn't work. Is there any other way I can do it?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 27 Sep 2011, 01:55 PM
Hello Alex,

Thank you for writing.

You can use a FocusPrimitive in order to notify your users when the button gets focused. Here is an example:
FocusPrimitive focus;
 
public Form1()
{
    InitializeComponent();
 
    BorderPrimitive border = new BorderPrimitive();
    border.ForeColor = Color.Red;
 
    focus = new FocusPrimitive(border);
    splitButton.DropDownButtonElement.Children.Add(focus);
    splitButton.GotFocus += new EventHandler(splitButton_GotFocus);
    splitButton.LostFocus += new EventHandler(splitButton_LostFocus);
}
 
void splitButton_LostFocus(object sender, EventArgs e)
{
    focus.Visibility = ElementVisibility.Collapsed;
}
 
void splitButton_GotFocus(object sender, EventArgs e)
{
    focus.Visibility = ElementVisibility.Visible;
}

Feel free to customize the BorderPrimitive according to your needs.

A bit off topic, I would like to remind you that your subscription package has expired, which means that you are not entitled to support services. I would highly recommend upgrading your license to the latest version in order to continue getting product updates and uninterrupted support services. Please, contact sales@telerik.com or visit your account for your upgrading options.

I hope that you find this information helpful.
 
Kind regards,
Stefan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

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