JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Immediate Solutions: Using the HScrollBar and VScrollBar Classes

Well, the new company banner logo is 2,000 by 4,000 pixels, which is a little too large for most screens. What can you do? One thing you might consider is using scroll bars to scroll the image (see "Scrolling Images" later in this chapter). There are two types of scroll bars, horizontal ones (HScrollBar) and vertical ones (VScrollBar). Here are the class hierarchies for both:

Object
   MarshalByRefObject
      Component
         Control
            ScrollBar
               HScrollBar

Object
   MarshalByRefObject
      Component
         Control
            ScrollBar
               VScrollBar

You can find the more notable public properties of the HScrollBar and VScrollBar class in Table 8.4 and the more notable events in Table 8.5. Note that as with other Windows forms controls, I am not listing the notable properties, methods, and events HScrollBar and VScrollBar inherit from the Control class—you can see all that in Chapter 5, Tables 5.1, 5.2, and 5.3.

Table 8.4: Noteworthy public properties of HScrollBar and VScrollBar objects.

Property

Means

LargeChange

Gets/sets the value added to or subtracted from to the Value property when the scroll bar itself is clicked (outside the scroll box).

Maximum

Gets/sets the upper limit of the scrollable range.

Minimum

Gets/sets the lower limit of the scrollable range.

SmallChange

Gets/sets the value added to or subtracted from to the Value property when the user clicks an arrow button.

Value

Gets/sets a value corresponding to the current position of the scroll box.

Table 8.5: Noteworthy public events of HScrollBar and VScrollBar objects.

Event

Means

Scroll

Occurs when the scroll box is moved (either by the mouse or the keyboard).

ValueChanged

Occurs when the Value property has changed, either by a Scroll event or programmatically.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor