A problem in the timer event Process

Source: Internet
Author: User

 

The following is a timer event process I have compiled:

In this process, static variable I must be defined using static. If Dim is used as a dynamic variableProgramThere is no overall error, but the expected results are not met.

 

 

Private sub timer1_timer ()

StaticI as integer
 

If I = 8 then
I = 1
End if
I = I + 1

'Execute imgbrid to move the image frame horizontally to the right.
Imgbrid. Left = imgbrid. Left + 60
If imgbrid. Left> me. scalewidth then
Imgbrid. Left = me. scaleleft-imgbrid. Width
End if

Select case I
Case 1
Imgbrid. Picture = imgbrids (0). Picture
Case 2
Imgbrid. Picture = imgbrids (1). Picture
Case 3
Imgbrid. Picture = imgbrids (2). Picture
Case 4
Imgbrid. Picture = imgbrids (3). Picture
Case 5
Imgbrid. Picture = imgbrids (4). Picture
Case 6
Imgbrid. Picture = imgbrids (5). Picture
Case 7
Imgbrid. Picture = imgbrids (6). Picture
Case 8
Imgbrid. Picture = imgbrids (7). Picture
End select

End sub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.