Making a form resizable with FormBorderStyle = None?

H

harrylmh

Hi,
I've really been struggling with this. How do I make a form resizable
with FormBorderStyle = None? I've had problems trying to get the form
to start resizing by following the mouse position(after the mouse is
at the edge of the form and starts to move out of the form with the
mouse button down)

Any ideas anybody? There's got to be an easier and more effective way
right?

Thank you for your time
 
V

Vijaye Raji

You need to override WndProc and listen for the message WM_NCHITTEST

(I'd advise you to look up WM_NCHITTEST on MSDN)

And depending on where the cursor is, you can return HTLEFT, HTRIGHT,
HTBOTTOMLEFT, etc.

HTH

-vJ
 
A

AlexS

Hi, harryImh

If you want to resort to this you have to monitor non-client messages for
mouse in form WndProc and maybe PreProcessMessage. See WM_NC messages in
Platform SDK. You will need to emulate resizing behavior using such as
WM_NCHITTEST, WM_NCPAINT, WM_NCMOUSEMOVE and other.

I am not sure it is worth the effort.

HTH
Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top