|
-
Apr 16th, 2002, 12:34 PM
#1
Thread Starter
Lively Member
minimize problem
Here is the sub where the error comes up when i minimize a form.
Private Sub Form_Resize()
Image1.Width = ScaleX(picture2.Width, vbTwips, vbPixels) - 6
Image1.Height = ScaleY(picture2.Height, vbTwips, vbPixels) - 56
End Sub
If i want to minimize a form and make form resize work, is there anything i should do?
-
Apr 16th, 2002, 12:35 PM
#2
Thread Starter
Lively Member
oh, picture2 is the form name and image1 is a image box in the form.
-
Apr 16th, 2002, 12:43 PM
#3
Just add an 'On Error Resume Next' to the sub.
Form_resize gets fired when you minimize. The code is trying to turn Image1 inside out because the form is minimized and the heights and widths are out of wack.
Thats the easy way and the way Microsoft does it in the application wizard.
You could also do the following...
VB Code:
Private Sub Form_Resize()
If Me.WindowState <> vbMinimized Then
Image1.Width = ScaleX(picture2.Width, vbTwips, vbPixels) - 6
Image1.Height = ScaleY(picture2.Height, vbTwips, vbPixels) - 56
end if
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|