Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 384: A form can't be moved or sized while maximized??

Status
Not open for further replies.

rahmanjan

Programmer
Apr 13, 2003
180
AU
Hi all,

I just want to know what is the best solution for this problem?

I have a form and i have set its maximize button to false so i dont' allow users to resize it. But still users can minimize the form.

i have kept the code bellow in the form resize event:
Me.Height = 7305
Me.Width = 8895
so if the user resize the form it comes back to its predefined size.

The problem is that if the user minimize the form by pressing the minimize buttun it crashes and raises the above error:

any solution?

regards
 
With Me
If .WindowState = vbMinimized Then Exit Sub
.Height = 7305
.Width = 8895
End With


Andy
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
"Why does my program keep showing error messages every time something goes wrong?"
 
Hi,
If you give
on error resume next as the first statement in resize event
it will not give the error
you can set to 0
if the setting the height/width etc

Regards
John


*** Even the Best, did the Bad and Made the Best ***

John Philip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top