pocket programs

Home
Products
Download
Licences
Support
Contact
DateTimePicker
MonthCal
Trackbar
Up-Down
-Methods
-Styles
-Constants
-Example
Keypad
Sketch
Progressbar
Buy-Now
Support
Contact

Up-Down Controls

PP Controls offers up-down control which are a pair of arrow buttons that the user can click to increment or decrement a value. A minimum and maximum value for the up-down can be specified, and well as decimal or hex format.


Up-Down - Methods & Properties

NewUpDown

Long hWnd = PPCtrl.NewUpDown(hWnd, dwStyle)

Creates a new UpDown Control and returns the handle of the new control.

hWnd hWnd of parent form (or frame) or placeholder (hWnd)
DwStyle Specifies the style of the window being created.
If the style PC_PLACEHOLDER is specified, then hWnd refers to the control to be used as a as placeholder. The new Up-Down control will be placed on the form at the same location as this control, with the same size and font. The place-holder control is then hidden. Note: If PC_PLACEHOLDER style is not given, then hWnd specifies the parent window for the new control. The new control is positioned according to the current values of PPCtrl.Left, PPCtrl.Top, PPCtrl.Width and PPCtrl.Height. The font of the parent window is used.
UD1 = PPCtrl.NewUpDown(App.hInstance, hWnd, UDS_WRAP, Text1.hWnd)<br> UD1 = PPCtrl.NewUpDown(App.hInstance, Frame1.hWnd, TBS_AUTOTICS,0)

Min, Max

PPCtrl.Min(hWnd) = long<br> PPCtrl.Max(hWnd) = long<br> long = PPCtrl.Min(hWnd)<br> long = PPCtrl.Max(hWnd)

Retrieves/Sets the current minimum and maximum positions for the up-down control specified by hWnd.

PPCtrl.Min(ud1) = 1 PPCtrl.Max(ud1) = 100

Pos

PPCtrl.Pos(hWNd) = long<br> long = PPCtrl.Pos(hWnd)

Retrieves/Sets the currently position of the slider of the up-down control specified by hWnd.

PPCtrl.Pos(ud1)=now<br> level=PPCtrl.Pos(ud1)

Value

PPCtrl.Value(hWNd) = long<br> long = PPCtrl.Value(hWnd)

Retrieves/Sets the currently position of the slider of the up-down control specified by hWnd. (Identical in function to pos)

PPCtrl.Value(Ud1)=now<br> level=PPCtrl.Value(Ud1)

Base

PPCtrl.Base(hWnd) = 10<br> PPCtrl.Base(hWnd) = 16

Sets/Retrieves the current radix base (that is, either base 10 or 16) for the Updown control specified by hWnd.

PPCtrl.Pos(UD1)=10

Up-Down – Styles

UDS_ALIGNLEFT

Positions the up-down control next to the left edge of the buddy window. The buddy window is moved to the right, and its width is decreased to accommodate the width of the up-down control.

UDS_ALIGNRIGHT

Positions the up-down control next to the right edge of the buddy window. The width of the buddy window is decreased to accommodate the width of the up-down control.

UDS_ARROWKEYS

Causes the up-down control to increment and decrement the position when the UP ARROW and DOWN ARROW keys are pressed.

UDS_HORZ

Causes the up-down control's arrows to point left and right instead of up and down.

UDS_NOTHOUSANDS

Does not insert a thousands separator between every three decimal digits.

UDS_WRAP

Causes the position to "wrap" if it is incremented or decremented beyond the ending or beginning of the range.


Up-Down - Constants

Const UDS_WRAP = &H1 ' value wraps when Const UDS_ALIGNRIGHT = &H4 ' Align up down buttons at right Const UDS_ALIGNLEFT = &H8 ' Align up down buttons at left Const UDS_ARROWKEYS = &H20 ' React to arrow keys Const UDS_HORZ = &H40 ' Create horizontal buttons Const UDS_NOTHOUSANDS = &H80 ' Do not show thousands separator

Up-Down - Example

Dim PPCtrl As Object Dim Updown1, Updown2 as Long Set PPCtrl = CreateObject("PPControl.Controls") Updown1 = PPCtrl.NewUpDown(Text11.hWnd, UDS_ALIGNRIGHT + UDS_WRAP + PC_PLACEHOLDER) PPCtrl.Base(Updown1) = 10 PPCtrl.Min(Updown1) = 13 PPCtrl.Max(Updown1) = 77 PPCtrl.Pos(Updown1) = 67 Updown2 = PPCtrl.NewUpDown(Text12.hWnd, UDS_ALIGNRIGHT + UDS_WRAP + PC_PLACEHOLDER) PPCtrl.Base(Updown2) = 16