Larry Rebich Tip of the Month:

I have seen various tips that show how to set a 'minimum' sized window
[form]. The tips are all about the same. They rely on providing the minimum
size in twips and use a call back to an API. Most rely on a message hook
that if not 'unhooked' causes VB to crash if the code is run in the IDE.

I took a somewhat different approach. I'm using Michael Culley's safe
subclassing OCX and some code I found at Allapi.Net [], some code
from Karl E. Peterson [] and some code from my September 1998 tip
of the month [LocationLocationLocation] and cut and pasted it into a class
module I call 'clsMinWindow'. Then I wrote a demo program to show how to use
the conglomeration to restrict a form's minimum and maximum size.

While I was at it I added a 'Moved' event. Now you can tell when a form is


Larry Rebich

More tips link to:

No personal e-mail questions :-)