dcsimg
Results 1 to 6 of 6

Thread: [RESOLVED] Invalid Property Value on form minimize

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2008
    Posts
    268

    Resolved [RESOLVED] Invalid Property Value on form minimize

    Hi,

    I have a borderless form with a custom GUI. The minimize button has this code in the mouseup event.

    frmMain.WindowState = vbMinimized

    When fired, an "Invalid Property Value" error comes up and kills the program. Same thing happens if I change vbMinimized to 1.

    Thanks!

    David

  2. #2
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,252

    Re: Invalid Property Value on form minimize

    My guess is you are resizing/moving controls in the frmMain's Resize event, you probably need to check the forms window state.

    Code:
    Private Sub Form_Resize()
        If Me.WindowState = vbMinimized Then
           ' do something on minimized state....
        Else
            ' resize controls here...
        End If
    End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2008
    Posts
    268

    Re: Invalid Property Value on form minimize

    Ah, why didn't I realize that - makes sense! Thanks.

  4. #4
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [RESOLVED] Invalid Property Value on form minimize

    Couldn't you just avoid resizing the controls
    Code:
    Private Sub Form_Resize()
     If Me.WindowState = vbMinimized Then Exit Sub
    
       '
       '
       ' resize controls here...
       '
       '
    End If
    End Sub


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2008
    Posts
    268

    Re: [RESOLVED] Invalid Property Value on form minimize

    Yes that's what I ultimately did. Didn't go with your first Resume next suggestion, jms. ;-)

  6. #6
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [RESOLVED] Invalid Property Value on form minimize

    Yeah, that's why I removed it after giving it some thought. I use it at times but I know it is frowned upon


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width