How change corner rounding for RadSplitButton

5 posts, 1 answers
  1. Esteban Castorena
    Esteban Castorena avatar
    3 posts
    Member since:
    Jun 2010

    Posted 07 Dec 2010 Link to this post

    At design time, what property do I change to get rid of the default corner rounding for the RadSplitButton? Thanks.
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Dec 2010 Link to this post

    Hello Esteban,

    Do you mean the button itself, or the child buttons that may be contained in a RadSplitButton. If you could explain further or include a screenshot I'll try to help
    thanks
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Esteban Castorena
    Esteban Castorena avatar
    3 posts
    Member since:
    Jun 2010

    Posted 08 Dec 2010 Link to this post

    I want to change the look of the main button, not the child buttons. I've attached an image of a regular button where the BackColor = White, the ForeColor = DarkGreen, and the FlatStyle = Popup. I want to get a RadSplitButton to looks similar to this with the non-rounded edges. Thanks.
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 08 Dec 2010 Link to this post

    Hi Esteban,

    As far as I know, there is no FlatStyle for RadControls, but please try this and let me know any adjustments that you would like to make

    Richard

    Imports Telerik.WinControls.UI
    Imports Telerik.WinControls
    Imports Telerik.WinControls.Primitives
      
    Public Class MyRadSplitButton
        Inherits RadSplitButton
      
      
        Public Sub New()
            MyBase.New()
            Me.ThemeClassName = "Telerik.WinControls.UI.RadSplitButton"
        End Sub
      
        Protected Overrides Sub OnLoad(ByVal desiredSize As System.Drawing.Size)
            Dim shape As New RoundRectShape()
      
            shape.BottomLeftRounded = True
            shape.BottomRightRounded = False
            shape.TopLeftRounded = False
            shape.TopRightRounded = False
            shape.Radius = 0
            Me.DropDownButtonElement.Shape = shape
      
            CType(Me.DropDownButtonElement.Children(1).Children(0).Children(0), FillPrimitive).BackColor = Color.White
            CType(Me.DropDownButtonElement.Children(1).Children(0).Children(0), FillPrimitive).GradientStyle = GradientStyles.Solid
      
            CType(Me.DropDownButtonElement.Children(1).Children(1).Children(0), FillPrimitive).BackColor = Color.White
            CType(Me.DropDownButtonElement.Children(1).Children(1).Children(0), FillPrimitive).GradientStyle = GradientStyles.Solid
      
            Me.DropDownButtonElement.ForeColor = Color.DarkGreen
      
            MyBase.OnLoad(desiredSize)
        End Sub
      
      
    End Class
  6. Esteban Castorena
    Esteban Castorena avatar
    3 posts
    Member since:
    Jun 2010

    Posted 08 Dec 2010 Link to this post

    Thanks Richard, that helped.
Back to Top
UI for WinForms is Visual Studio 2017 Ready