Max

This property returns and sets the largest font size displayed in the Size list box of the Font Common Dialog dialog box. The Max property also returns and sets a scroll bar position's maximum Value property setting when the scroll box is in its bottom or rightmost position.

Syntax

object.Max [= value]

Parameters

object
Object expression that evaluates to a CommonDialog, HScrollbar, or VScrollbar control.
value
Numeric expression that specifies the maximum or minimum Value property setting.

For each property, you can specify an integer from 32,768 through 32,767. The default setting for Max is 32,767.

Remarks

Use Max to set a range appropriate to how a scroll bar control is used—for example, as an input device or as an indicator of speed or quantity. Windows CE automatically sets ranges for scroll bars proportional to the contents of forms, ComboBox controls, and ListBox controls. However, for HScrollBar or VScrollBar you must specify these ranges.

Typically, you set Max at design time. You also can set this property in code at run time if the scrolling range must change dynamically—for example, when adding records to a database that can be scrolled through. Set the maximum and minimum scrolling increments for a scroll bar control with the LargeChange and SmallChange properties.

The Max property must be set before the Min property, otherwise a run-time error occurs and the Min property is ignored. A run-time error also occurs if Max is set to less than Min.