Microsoft Office Tutorials and References
In Depth Information
ListBox Techniques
This procedure sets various properties of the ScrollBar controls by using values based on the
active window.
When the ScrollBarZoom control is used, the ScrollBarZoom_Change procedure (which
follows) is executed. This procedure sets the ScrollBar control’s Value to the ActiveWindow’ s
Zoom property value. It also changes a label to display the current zoom factor.
Private Sub ScrollBarZoom_Change()
With ActiveWindow
.Zoom = ScrollBarZoom.Value
LabelZoom = .Zoom & “%”
End With
End Sub
Worksheet scrolling is accomplished by the two procedures that follow. These procedures set the
ScrollRow or ScrollColumns property of the ActiveWindow object equal to the
appropriate ScrollBar control value.
Private Sub ScrollBarColumns_Change()
ActiveWindow.ScrollColumn = ScrollBarColumns.Value
End Sub
Private Sub ScrollBarRows_Change()
ActiveWindow.ScrollRow = ScrollBarRows.Value
End Sub
Rather than use the Change event in the preceding procedures, you can use the
Scroll event. The difference is that the event is triggered when the ScrollBars are
dragged — resulting in smooth zooming and scrolling. To use the Scroll event, just
make the Change part of the procedure name Scroll .
ListBox Techniques
The ListBox control is extremely versatile, but it can be a bit tricky to work with. This section
contains of a number of examples that demonstrate common techniques that involve the
ListBox control.
In most cases, the techniques described in this section also work with a ComboBox
control.
 
Search JabSto ::




Custom Search