Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have winform with FormBorderStyle = None and I need add deployment form if he touch sides screen (it is easy) , but how add aero demo as form will be deploy, i can not.
Searched in functions Dwmapi.dll, but did not find.
Screenshot.
Posted
Updated 19-Oct-18 11:19am
v2

Add the following to your Form:
C#
protected override CreateParams CreateParams
{
   get
   {
      CreateParams cp = base.CreateParams;
      cp.Style |= 0x40000; //WS_SIZEBOX;
      return cp;
   }
}


though I usually use:
C#
protected override CreateParams CreateParams
{
   get
   {
      CreateParams cp = base.CreateParams;
      {
         cp.Style |= 0x20000 | 0x80000 | 0x40000; //WS_MINIMIZEBOX | WS_SYSMENU | WS_SIZEBOX;
      }
      return cp;
   }
}
 
Share this answer
 
Comments
cyber_ua 1-Apr-13 1:57am    
Does not work if i drag form and touch to sides.
Jack Han 31-Jul-13 15:21pm    
Well the borders are ok, but how do I get a control, a panel for a example, to behave as if it were a title bar? And this includes aerosnap? Aslo no aero borders but a custom form that can be resized and have aerosnap properites?
toATwork 1-Apr-13 12:09pm    
Dou you have a caption bar? Did you overwrite the HitTest function?
cyber_ua 1-Apr-13 12:56pm    
What is the HitTest function?
toATwork 2-Apr-13 2:49am    
It is used to determine where the mouse cursor is in the given Form, e.g. border, caption...
Check this out:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms645618%28v=vs.85%29.aspx
I found solution, need handle WM_NCHITTEST if cursor on title bar return HTCAPTION. Test code if all form title bar.

C#
protected override void WndProc(ref Message message)
        {
            base.WndProc(ref message);

            if (message.Msg == WM_NCHITTEST )
                            message.Result = (IntPtr)HTCAPTION;
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900