40 likes | 154 Views
The PictureBox Control. Prefix – pic Image Property – Changes the image or file that appears inside of the PictureBox SizeMode – can be set to either Normal. StretchImage, AutoSize, or CenterImage Visible – Can be set to either True or False. Size – is the picture box size in pixels.
E N D
The PictureBox Control • Prefix – pic • Image Property – Changes the image or file that appears inside of the PictureBox • SizeMode – can be set to either Normal. StretchImage, AutoSize, or CenterImage • Visible – Can be set to either True or False. • Size – is the picture box size in pixels.
PictureBox cont… • A click event procedure can be coded for the picturebox. • Images for a project should be copied to the bin folder located in the project folder. • The image in a picturebox can be changed at run time by using the Image class in a statement similar to: Me.picNameofImage.Image = Image.FromFile(“NameofFile.bmp”) • The FromFile() method in the Image class creates and image object.
Timer • Prefix – tmr • Interval – is the amount of time that passes before the Tick event procedure is executed. Interval is specified in milliseconds between 0 and 64,767 where 1,000 equals 1 second. • Enabled – is set to True to allow a Tick event to occur at the end of each interval.
Timer Event Procedure • A Tick event procedure is coded for each timer object added to an application. • A Tick event occurs after the time specified in the Interval property elapses. For example, if the Interval is set to 1000, then a Tick event occurs every second. • Start() – starts a timer and can be used instead of the Enabled property. Timer.Start() • Stop() – stops a timer. Timer.Stop()