JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the PictureBox Class

As discussed in the In Depth section of this chapter, you use picture boxes to display images. In VB6 and before, picture boxes were powerhouses of image handling and editing, but now their capabilities are limited to displaying images and a little more, such as stretching those images. The PictureBox class is derived directly from the Control class:

Object
   MarshalByRefObject
      Component
         Control
            PictureBox

You can find the more notable public properties of the PictureBox class in Table 7.10, and the more notable events in Table 7.11. Note that as with other Windows forms controls, I am not listing the notable properties, methods, and events PictureBox inherits from the Control class, such as the Click event—you can see all that in Chapter 5, Tables 5.1, 5.2, and 5.3.

Table 7.10: Noteworthy public properties of PictureBox objects.

Property

Means

BorderStyle

Gets/sets the border style for the picture box.

Image

Gets/sets the image that is in a picture box.

Table 7.11: Noteworthy public events of PictureBox objects.

Event

Means

Resize

Occurs when the picture box is resized.

SizeModeChanged

Occurs when SizeMode changes.

Tip 

Although picture boxes no longer have drawing methods built in, you can use a picture box's built-in Graphics object to do as much as picture boxes used to do and more—see "Scrolling Images" in Chapter 8 to get a sample, where we're scrolling an image in a picture box.

Related solution:

Found on page:

Scrolling Images

349

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor