Highlight a RadSplitButton

8 posts, 4 answers
  1. Jean-Marc Windholz
    Jean-Marc Windholz avatar
    42 posts
    Member since:
    Sep 2009

    Posted 04 Nov 2010 Link to this post

    Dear forum,
    I would like to know if it is possible to highlight a RadSplitButton and fix the highlighting also when I move the mouse out from the button.
    I try to explain better: now the RadSplitButton  becomes highlight only when I move over it, I would like to fix the highlight clickink on it,
    like a ToggleButton, to permit me to understand which one of the RadSplitButtons of my radribbonbar is actived in this moment.
    It should be the same situation of a group of ToggleButton in a group.

    thank you
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 04 Nov 2010 Link to this post

    Hello,

    i'm looking into how to change the IsMouseOver for the RadSplitButton which I have been trying to do in a similar manner to this forum post but as yet with no luck.

    However, I have managed to change the fill color of the main button section which you may find useful.
    Me.RadSplitButton1.DropDownButtonElement.ActionButton.ButtonFillElement.BackColor = Color.Orange
    Me.RadSplitButton1.DropDownButtonElement.ActionButton.ButtonFillElement.GradientStyle = GradientStyles.Solid

    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Nov 2010 Link to this post

    Hello Jean-Marc,

    Was this useful to you? If so, please remember to mark as answer. Otherwise, if you need further help, just let me know.
    Regards,
    Richard
  5. Jean-Marc Windholz
    Jean-Marc Windholz avatar
    42 posts
    Member since:
    Sep 2009

    Posted 09 Nov 2010 Link to this post

    Sorry, I mistook in my description ,
     I'm using  RadSplitButtonElement  and the DropDownButtonElement doesn't exist.
  6. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Hello Jean-Marc,

    In that case, it's almost as above..

    RadSplitButtonElement.ActionButton.ButtonFillElement.BackColor = Color.Orange 
    RadSplitButtonElement.ActionButton.ButtonFillElement.GradientStyle = GradientStyles.Solid

    hope that helps
    Richard
  7. Jean-Marc Windholz
    Jean-Marc Windholz avatar
    42 posts
    Member since:
    Sep 2009

    Posted 09 Nov 2010 Link to this post

    thank you for help me.
    The solution is good  but I'm still looking a way to obtain the same effect of a radToggleButton when it is selected.

    best regards
  8. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Hi Jean-Marc,

    for a ToggleButton, you can use the following:

    Private Sub RadToggleButton2_ToggleStateChanged(ByVal sender As System.Object, ByVal args As Telerik.WinControls.UI.StateChangedEventArgs) Handles RadToggleButton2.ToggleStateChanged
        If Me.RadToggleButton2.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On Then
            Me.RadToggleButton2.ButtonElement.ButtonFillElement.BackColor = Color.Blue
            Me.RadToggleButton2.ButtonElement.ButtonFillElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
        Else
            Me.RadToggleButton2.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
            Me.RadToggleButton2.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.GradientStyleProperty, Telerik.WinControls.ValueResetFlags.Local)
        End If
    End Sub

    Let me know if that helps or you need more information
    richard
  9. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 09 Nov 2010 Link to this post

    Hello,

    You could also use one of these:
    element.ActionButton.IsMouseDown = true;
    //or
    element.ActionButton.IsMouseOver = true;

    To avoid overwriting the backcolor of the button, in order to simulate a click or a mouse down, depends on the case

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
Back to Top
UI for WinForms is Visual Studio 2017 Ready