- Properties that affect the behavior of Image controls let you change what this control does once certain actions happen in the program. The "Enabled" property, for example, lets you temporarily prevent the user from clicking on the control. You might use this feature when you're expecting user input for another control, thus making it impossible for the user to use the Image control until the user has provided that input. Since the data type of the "Enabled" property is Boolean, you can give it one of two values: true or false. "Image1.enabled = true" is a sample statement showing how to make an Image control named "image1" able to accept user input.
- The Image control's appearance properties impact how this control appears on your user input form or another container for the control, such as an Excel spreadsheet. The "Width" and "Height" properties are examples of appearance properties. By setting these, you change how tall and wide an Image control appears to the user. Here's an example of setting these properties to make an Image control appear 200 pixels wide by 150 pixels high:
image1.width = 200
image1.height = 150 - The PictureBox control has more properties than the Image control. An example of a PictureBox property that affects how this control behaves is "WaitOnLoad." By setting this property to true or false, you can set whether this control will accept user input before loading the image specified in its Image property. For example, if you set this property to true, users can't click the control until its image is loaded.
- Like the Image control, the PictureBox control has several properties affecting how it looks on a spreadsheet or a user input form. One appearance-related property is the "Image" property, which specifies the image the user will see. You set this property either before or during your program's run time. To set it during run time, you can use a statement like "picturebox1.image = "c:\mypictures\house.jpg."
Affect the Image Control's Behavior
Affect the Image Control's Appearance
Affect the PictureBox Control's Behavior
Affect the PictureBox Control's Appearance
SHARE