You might be able to do this if you override WndProc and ignore non-client
mouse downs in the titlebar of your form. You would probably want to do some
additional hit testing to allow clicks on the system menu and the maximize,
minimize and close buttons (if they are visible).
private int captionHeight = SystemInformation.CaptionHeight;
private Size captionButtonSize = SystemInformation.CaptionButtonSize;
protected override void WndProc(ref Message m)
{
if(m.Msg == 0xa1) //(WM_NCLBUTTONDOWN)
{
Point pt = this.PointToClient(Control.MousePosition);
//very simple hittest to allow clicks on buttons in the caption
if( pt.Y < captionHeight && pt.X > captionButtonSize.Width - 4 && pt.X <
this.Width - 3 * captionButtonSize.Width)
{
Console.WriteLine(m);
return;// ignore them
}
}
base.WndProc (ref m);
}
==================================
Clay Burch, .NET MVP
Visit
www.syncfusion.com for the coolest tools