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

How change corner rounding for RadSplitButton

4 Answers 88 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Esteban Castorena
Top achievements
Rank 1
Esteban Castorena asked on 07 Dec 2010, 10:41 PM
At design time, what property do I change to get rid of the default corner rounding for the RadSplitButton? Thanks.

4 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 07 Dec 2010, 11:35 PM
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
0
Esteban Castorena
Top achievements
Rank 1
answered on 08 Dec 2010, 04:38 PM
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.
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 08 Dec 2010, 05:19 PM
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
0
Esteban Castorena
Top achievements
Rank 1
answered on 08 Dec 2010, 08:01 PM
Thanks Richard, that helped.
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Esteban Castorena
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Esteban Castorena
Top achievements
Rank 1
Share this question
or