|
-
Sep 18th, 2012, 10:54 AM
#1
Thread Starter
PowerPoster
[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 
-
Sep 18th, 2012, 11:26 AM
#2
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?????
-
Sep 18th, 2012, 11:47 AM
#3
Thread Starter
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|