Fog Creek Software
Discussion Board




Snap forms in VB6?

Joel-

I just finished the hard copy of your book (which was fun, btw -- I don't usually get to read funny parts of work-related books to my partner!), in which you suggest making forms snap to the edges of other forms, a la WinAmp.  Any suggestions for how to accomplish this in VB6?

Sam Livingston-Gray
Saturday, February 28, 2004

That's a good question. I'm not sure. You're almost certainly going to have to do it at the Windows level (probably by handling the WM_ENTERSIZEMOVE message using something like the VBAccelerator subclass control.)

Joel Spolsky
Fog Creek Software
Sunday, February 29, 2004

And if you go that route, don't forget to test it on a multi-monitor system...

Philo

Philo
Monday, March 01, 2004

Amen Brother Philo!

Ken Klose
Monday, March 01, 2004

Ooh, an excuse to spend money I ain't got!  (Besides which, my users work in social service agencies.  Half of them dream of having a computer that wasn't donated three years ago.  Multiple monitors might as well be FTL-capable spaceships.)

But seriously, would it make a difference, multi-monitor-wise, if we were talking about MDI child forms?  Can an MDI parent form even be expanded to fill both monitors?

Sam Livingston-Gray
Monday, March 01, 2004

WM_WINDOWPOSCHANGING is what you are looking for, because it is called right *before* the resizing and moving actually takes place.

For multi-monitor support just make sure you snap against the edges of the current monitor and not the full workspace.

Jan Derk
Monday, March 01, 2004

Look here

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=27489&lngWId=1

for example code for snapping forms.

PeterM

PeterM
Wednesday, March 03, 2004

Cool, I'll check that out.  And with that, it's official:  this is now my favorite Fog Creek forum.  ;>

Sam Livingston-Gray
Wednesday, March 03, 2004

M a Starter in VB....So can anyone tell me how an MDI child is placed in the MDI parent window without moving in the heirarchial way????The child forms are keeping on moving downwards......Can anyone solve my problem....

Danie.T.John
Monday, March 29, 2004

*  Recent Topics

*  Fog Creek Home