[Solved] Changing RadRibbonForm borderwidth is problematic

1 Answer 19 Views
RibbonForm
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Curtis asked on 17 Mar 2026, 07:59 PM

I've got a RadRibbonForm as my main form.  I'd like my users to be able to resize this form - and they can but the border is a single pixel making it nearly impossible to position your mouse over it in order to drag-and-resize.

I've tried creating my own Telerik.WinControls.UI.FormControlBehavior class called "CustomFormControlBehavior" that Inherits Telerik.WinControls.UI.FormControlBehavior with BorderWidth property that looks like this:

Public Overrides ReadOnly Property BorderWidth As Padding
Get
Return New Padding(10)
End Get
End Property

and in my main form's constructor, following InitializeComponent() I've added the following:

        Dim Behavior As Telerik.WinControls.UI.FormControlBehavior = New CARMSCustomRibbonFormBehavior()
        Me.FormBehavior = Behavior

The above code will not execute!

Can you help me resolve how to change the BorderWidth of my RadRibbonForm?  How close was I to the solution!? :)

Kindest regards, all!

-C

 

 

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 19 Mar 2026, 04:29 PM

Hello Curtis,

May I ask if it would be possible to override the WndProc method of the form and modify the consts to achieve the desired behavior?

The following code snippet showcases this suggestion's implementation (you could modify the highlighted one to increase/decrease the handler resize area):

Protected Overrides Sub WndProc(ByRef m As Message)
    Const WM_NCHITTEST As Integer = &H84
    Const HTLEFT As Integer = 10
    Const HTRIGHT As Integer = 11
    Const HTTOP As Integer = 12
    Const HTTOPLEFT As Integer = 13
    Const HTTOPRIGHT As Integer = 14
    Const HTBOTTOM As Integer = 15
    Const HTBOTTOMLEFT As Integer = 16
    Const HTBOTTOMRIGHT As Integer = 17
    Const RESIZE_HANDLE_SIZE As Integer = 20

    If m.Msg = WM_NCHITTEST Then
        MyBase.WndProc(m)

        If CInt(m.Result) = &H01 Then
            Dim cursor As Point = Me.PointToClient(Cursor.Position)

            If cursor.X <= RESIZE_HANDLE_SIZE Then
                m.Result = CType(HTLEFT, IntPtr)
            ElseIf cursor.X >= Me.ClientSize.Width - RESIZE_HANDLE_SIZE Then
                m.Result = CType(HTRIGHT, IntPtr)
            ElseIf cursor.Y <= RESIZE_HANDLE_SIZE Then
                m.Result = CType(HTTOP, IntPtr)
            ElseIf cursor.Y >= Me.ClientSize.Height - RESIZE_HANDLE_SIZE Then
                m.Result = CType(HTBOTTOM, IntPtr)
            End If
        End If

        Return
    End If

    MyBase.WndProc(m)
End Sub

Could you give this suggestion a try and let me know how it goes?

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 20 Mar 2026, 04:35 PM

I see you like to kick it "Old School!"  I haven't seen this code in 20 years :)

I'll give it a try!

Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 20 Mar 2026, 04:48 PM

No Joy but was worth a shot - I'm going to have to manually replace nearly every UI control in this project (thousands of them) with Telerik controls to get my skinning correct anyway so perhaps I'll just build my own Parent form and manage it that way,

Thank you for reaching out to me!

-c

Stenly
Telerik team
commented on 24 Mar 2026, 08:31 AM

Indeed, you could extend the forms and override the WndProc method to introduce this change. If any additional assistance is required, please let me know.
Tags
RibbonForm
Asked by
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Stenly
Telerik team
Share this question
or