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

RadForm event for Double Clicking the title bar

1 Answer 205 Views
TitleBar
This is a migrated thread and some comments may be shown as answers.
Adrian
Top achievements
Rank 1
Adrian asked on 29 Jun 2011, 09:02 PM
I can't seem to find the event that is fired when the Title Bar of a RadForm is double clicked.
My form is maximized at all times and I don't want the user to change the size of the windown by double clicking the title bar. Form should always stay at maximized state and this (this.WindowState = System.Windows.Forms.FormWindowState.Maximized) is not preventing the resize on Title Bar double click.

 MaximizeBox property is set to False to prevent the user from clicking the form's maximize button. This part is working fine.

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 05 Jul 2011, 10:36 AM
Hi Adrian,

Thank you for writing.

Please consider the following code snippet:

const Int32 HTCAPTION = 0x2;
const Int32 WM_NCLBUTTONDBLCLK = 0xA3;
 
protected override void WndProc(ref Message msg)
{
  switch (msg.Msg)
  {
    case WM_NCLBUTTONDBLCLK:
      if (msg.WParam.ToInt32() == HTCAPTION)
        return;
      break;
  }
  base.WndProc(ref msg);
}

You have to add these constants and the method to your form.

I hope this will help. If you have further questions, feel free to ask.

Regards,
Ivan Petrov
the Telerik team
Registration for Q2 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting July 18th and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TitleBar
Asked by
Adrian
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or