the picturebox control prefix prefix – pic image property picturebox image property – changes...

4
The PictureBox Control The PictureBox Control Prefix Prefix – pic Image Property Image Property – Changes the image or file that appears inside of the PictureBox PictureBox SizeMode SizeMode – can be set to either Normal. StretchImage, AutoSize, or CenterImage Visible Visible – Can be set to either True or False. Size Size – is the picture box size in pixels.

Upload: lee-crawford

Post on 13-Jan-2016

232 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The PictureBox Control Prefix Prefix – pic Image Property PictureBox Image Property – Changes the image or file that appears inside of the PictureBox SizeMode

The PictureBox ControlThe PictureBox Control

• Prefix Prefix – pic

• Image PropertyImage Property – Changes the image or file that appears inside of the PictureBoxPictureBox

• SizeModeSizeMode – can be set to either Normal. StretchImage, AutoSize, or CenterImage

• VisibleVisible – Can be set to either True or False.

• SizeSize – is the picture box size in pixels.

Page 2: The PictureBox Control Prefix Prefix – pic Image Property PictureBox Image Property – Changes the image or file that appears inside of the PictureBox SizeMode

PictureBox cont…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 ImageImage class in a statement similar to:Me.picNameofImage.Image = Image.FromFile(“NameofFile.bmp”)

• The FromFile()FromFile() method in the Image class creates and image object.

Page 3: The PictureBox Control Prefix Prefix – pic Image Property PictureBox Image Property – Changes the image or file that appears inside of the PictureBox SizeMode

TimerTimer

• PrefixPrefix – tmr

• IntervalInterval – 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.

• EnabledEnabled – is set to True to allow a Tick event to occur at the end of each interval.

Page 4: The PictureBox Control Prefix Prefix – pic Image Property PictureBox Image Property – Changes the image or file that appears inside of the PictureBox SizeMode

Timer Event ProcedureTimer 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()Start() – starts a timer and can be used instead of the Enabled property. Timer.Start()

• Stop()Stop() – stops a timer. Timer.Stop()