Results 1 to 3 of 3

Thread: [RESOLVED] make a picturebox expand by increments using a timer

  1. #1

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Resolved [RESOLVED] make a picturebox expand by increments using a timer

    Hi
    I have a picturebox that contains images and labels
    I am trouble make it expand to the proper height-width using a timer
    Private Sub Timer2_Timer() 'expand

    With picOpenOptions
    .Visible = True
    .Width = .Width + 90
    .Height = .Height + 160

    If .Width >= 2025 And .Height >= 4095 Then
    Timer2.Enabled = False
    End If
    sometimes the height is wrong and other times the width
    How can i write this ?
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: make a picturebox expand by increments using a timer

    don't forget your End Width and End sub, ....if you change the 'And' to an 'Or' in your IF statement, does that do what you want?????

  3. #3

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: make a picturebox expand by increments using a timer

    Thanks i worked it out
    Private Sub Timer2_Timer() 'expand

    Dim intWidth As Integer
    Dim intHeight As Integer
    With picOpenOptions

    If .Width + 90 > 2025 Then
    intWidth = 2025
    Else
    intWidth = .Width + 90
    End If

    If .Height + 160 > 4095 Then
    intHeight = 4095
    Else
    intHeight = .Height + 160
    End If
    .Visible = True
    .Width = intWidth
    .Height = intHeight

    If .Width = 2025 And .Height = 4095 Then
    Timer2.Enabled = False
    End If

    End With

    End Sub
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

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