Resizing borderless form in Windows Forms C#? -


i've tried this tutorial. borderless resizable, problem i've tried anchor objects, when resize form, these objects still remained @ same position.

my code:

protected override void wndproc(ref message m)         {             const int resize_handle_size = 10;              switch (m.msg)             {                 case 0x0084/*nchittest*/ :                     base.wndproc(ref m);                      if ((int)m.result == 0x01/*htclient*/)                     {                         point screenpoint = new point(m.lparam.toint32());                         point clientpoint = this.pointtoclient(screenpoint);                         if (clientpoint.y <= resize_handle_size)                         {                             if (clientpoint.x <= resize_handle_size)                                 m.result = (intptr)13/*httopleft*/ ;                             else if (clientpoint.x < (size.width - resize_handle_size))                                 m.result = (intptr)12/*httop*/ ;                             else                                 m.result = (intptr)14/*httopright*/ ;                         }                         else if (clientpoint.y <= (size.height - resize_handle_size))                         {                             if (clientpoint.x <= resize_handle_size)                                 m.result = (intptr)10/*htleft*/ ;                             else if (clientpoint.x < (size.width - resize_handle_size))                                 m.result = (intptr)2/*htcaption*/ ;                             else                                 m.result = (intptr)11/*htright*/ ;                         }                         else                         {                             if (clientpoint.x <= resize_handle_size)                                 m.result = (intptr)16/*htbottomleft*/ ;                             else if (clientpoint.x < (size.width - resize_handle_size))                                 m.result = (intptr)15/*htbottom*/ ;                             else                                 m.result = (intptr)17/*htbottomright*/ ;                         }                     }                     return;             }             base.wndproc(ref m);         }          protected override createparams createparams         {                         {                 createparams cp = base.createparams;                 cp.style |= 0x20000; // <--- use 0x20000                 return cp;             }         } 

while can resize borderless, can't make objects want. , question, how move form when click panel. clicked , nothing happen.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -