Min Form Size

  • Thread starter Thread starter ALESSANDRO Baraldi
  • Start date Start date
A

ALESSANDRO Baraldi

How can i control the minsize of my form...?
I know with SubClass, but i don't know how
to read the Right Size during Resize.

Thanks
 
Here is an example to keep a form at a minimum of 3" wide x 0.75" high.

Private Sub Form_Resize()
If Me.InsideWidth < 3 * 1440 Then
Me.InsideWidth = 3 * 1440
End If
If Me.InsideHeight < 0.75 * 1440 Then
Me.InsideHeight = 0.75 * 1440
End If
End Sub

The 1440 is because the measurement is actually in a unit called "twips".
There are 1440 twips per inch.
 
ALESSANDRO said:
How can i control the minsize of my form...?
I know with SubClass, but i don't know how
to read the Right Size during Resize.


Don't know how to work with subclass, but a form's current
size is available in its InsideHeight and InsideWidth
properties.
 
Wayne Morgan said:
Here is an example to keep a form at a minimum of 3" wide x 0.75" high.

Private Sub Form_Resize()
If Me.InsideWidth < 3 * 1440 Then
Me.InsideWidth = 3 * 1440
End If
If Me.InsideHeight < 0.75 * 1440 Then
Me.InsideHeight = 0.75 * 1440
End If
End Sub

The 1440 is because the measurement is actually in a unit called "twips".
There are 1440 twips per inch.

Yess ....! Simple and Correct.

Thanks.
 
ALESSANDRO Baraldi said:
Yess ....! Simple and Correct.

Thanks.
--

Work, but in this way if i go to reduce the Mouse Pointer try to Reduce
the Form and go in Reducing direction , the event procedure restore to the
MinSize
so the Video effect is very Bad.

I have thought to use the SubClass in order to block the Mouse,
but probably you can give me a more easy suggest...!

Thanks.
 
Marshall Barton said:
Don't know how to work with subclass, but a form's current
size is available in its InsideHeight and InsideWidth
properties.

I try, but a very bad Video effect, the Mouse try to go
in the Reducing direction and the Form Scroll From
the minsize and the Mouse position....!

Any idea...?
 
ALESSANDRO said:
I try, but a very bad Video effect, the Mouse try to go
in the Reducing direction and the Form Scroll From
the minsize and the Mouse position....!


I don't know what you tried. If it was the resize event as
in your other replies, I agree it's not too good.

No I don't have any more ideas and I can't help you with
whatever you meant by subclass, but at least you now know
what the current size of the form is.
 
The only thing I can think of then would be the subclass as you have
mentioned in order to keep the mouse from moving the form more. I don't know
how to do that.
 
Wayne Morgan said:
The only thing I can think of then would be the subclass as you have
mentioned in order to keep the mouse from moving the form more. I don't know
how to do that.

Yes i suppose it.
I try with SubClass, but the Form's Size are not
updated on SubClass, i retrive the Normal Size before
my Risize Action.
Probably i can read Mouse Position and Calculate the
translation Movement from the First Reducing Event...!

It's a very bad solution, not really hard to do, but i think
to hard to do this....!


Thanks again.
 
Back
Top