Private Sub Form_Resize() If Me.WindowState <> vbMinimized Then If Me.Width < 2000 Then Me.Width = 2000 If Me.Height < 2000 Then Me.Height = 2000 End If End Sub
[/tt]
On a child form You should change what vb5prgrmr said from
If Me.WindowState <> vbMinimized Then
to
If (Me.WindowState <> vbMinimized)or (Me.WindowState <> vbMaximized)Then
to avoid side affects, it can happen that a MIDI form has a size smaller than what you wish, the child form can react with an error. Its also good practice because you never know what a user is doing, perhaps a user changed the width or height of the task bar to 90% of the screen, for what ever strange reason...
One of my best teachers always said :
There is nothing that doesn't exist.
Of course, this solution does have the (minor) drawback that the rubberbanding isn't limited by the extents that you choose - and is particulalry noticeable if you have full window dragging enabled which results in some additional visual artifacts.
It does have the advantage of being slightly simpler than the API variant.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.