Results 1 to 3 of 3

Thread: minimize problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Location
    england
    Posts
    87

    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?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Location
    england
    Posts
    87
    oh, picture2 is the form name and image1 is a image box in the form.

  3. #3
    Red Rush-In
    Guest
    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:
    1. Private Sub Form_Resize()
    2.      If Me.WindowState <> vbMinimized Then
    3.           Image1.Width = ScaleX(picture2.Width, vbTwips, vbPixels) - 6
    4.           Image1.Height = ScaleY(picture2.Height, vbTwips, vbPixels) - 56
    5.      end if
    6. 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
  •  



Click Here to Expand Forum to Full Width