Edit this page

Detecting when the User Drags the RadTitleBar

The following example, demonstrates how to detect when the user drags the title bar and to how to get its coordinates:

Detecting when the TitleBar is dragged

public const int WM_WINDOWPOSCHANGED = 0x47;
protected override void WndProc(ref Message m)
{
    if (m.Msg == WM_WINDOWPOSCHANGED)
    {
        this.Text = Control.MousePosition.ToString();
    }
    base.WndProc(ref m);
}

Public Const WM_WINDOWPOSCHANGED As Integer = 71
Protected Overloads Overrides Sub WndProc(ByRef m As Message)
    If m.Msg = WM_WINDOWPOSCHANGED Then
        Me.Text = Control.MousePosition.ToString()
    End If
    MyBase.WndProc(m)
End Sub

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy