Public Class Form1 Public PBH As Integer Public PBW As Integer Public times As Integer Public locx As Integer Public locy As Integer Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Timer1.Enabled = True ' Turn On Timer Tick PBH = 130 ' Set Picturebox height to 130 PBW = 164 ' Set Picturebox width to 164 times = 10 ' Number of timer to run routine before exit locx = 60 locy = 60 End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Do ' start main loop to shrink PB1 PictureBox1.Height = PBH ' Reset Picturebox 1 Height PictureBox1.Width = PBW ' Reset Picturebox 1 Width PictureBox1.Location = New Point(locx, locy) ' Reset x.y pos PBH = PBH - 1 : PBW = PBW - 1 : locx = locx + 1 : locy = locy + 1 ' Decrease size of PB increase location x,y Call Delay() ' Slow down graphics for effect If PBH > 0 Then Continue Do ' Keep making it smaller if limit not reached Loop Until PBH = 0 ' If limit is reached then move to next loop PBH = 1 : PBW = 35 ' Reset starting points for Picturebox 1 Do ' Start to make PB1 Larger again PictureBox1.Height = PBH ' Reset Picturebox 1 Height PictureBox1.Width = PBW ' Reset Picturebox 1 Width PictureBox1.Location = New Point(locx, locy) ' Increase location x,y PBH = PBH + 1 : PBW = PBW + 1 : locx = locx - 1 : locy = locy - 1 ' Increase size of PB1 Call Delay() ' Slow down for graphics effect If PBH < 130 Then Continue Do ' Keep going until limit is reached Loop Until PBH = 130 : Timer1.Enabled = False ' Once limits is reached turnoff timer tick End Sub Public Sub Delay() For t = 1 To 2500000 : Next t End Sub End Class
PictureBox1.Height = PBH ' Reset Picturebox 1 Height PictureBox1.Width = PBW ' Reset Picturebox 1 Width PictureBox1.Location = New Point(locx, locy) ' Increase location x,y PictureBox1.Update()
PictureBox
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)