pocket programs

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

Numeric Keypad Controls

PP Controls offers a control for entering numeric values with a pop-up keypad. A prefix (i.e. currency symbol) and suffix (i.e. percent sign) can be specified. In addition, the button text of the Delete, clear, cancel and Ok buttons can be specified to allow for language specific definitions. The numeric control only allows numeric values and checks for valid decimal character.


Up-Down - Methods & Properties

NewNumeric

Long hWnd = PPCtrl.NewNumeric(hWnd, dwStyle)

Creates a new Numeric 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 Numeric 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.
NM1 = PPCtrl.NewNumeric(Text1.hWnd, PC_PLACEHOLDER)<br> NM1 = PPCtrl.NewUpDown(hwnd, WS_BORDER)

Prefix, Suffix

PPCtrl.Suffix(hWnd) = string<br> PPCtrl.Prefix(hWnd) = string

Retrieves/Sets the current prefix/suffix for the numeric control specified by hWnd.

PPCtrl.Prefix(Num1) = “US$” PPCtrl.Suffix (Num1) = “%”

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)

Text

PPCtrl.Text(hWNd) =str str = PPCtrl.Text(hWnd)

Retrieves/Sets the text of the numeric control specified by hWnd.

PPCtrl.Text(Num1)=”123.45” level=PPCtrl.Text(Num1)

DecimalChr

PPCtrl.DecimalChr(hWnd)= str

Sets Decimal seperator character for the numeric control specified by hWnd. By default the value from the regional settings is used.

PPCtrl.DecimalChr(Num1)=”.”

KeypadOk

PPCtrl.KeypadOK(hWnd)= str

Sets the text for the OK button on the pop-up keypad for the numeric control specified by hWnd.

PPCtrl.KeypadOK(Num1)=”Ja”

KeypadDelete

PPCtrl.KeypadDelete(hWnd)= str

Sets the text for the Delete button on the pop-up keypad for the numeric control specified by hWnd.

PPCtrl.KeypadDelete(Num1)=”DEL”

KeypadClear

PPCtrl.KeypadClear(hWnd)= str

Sets the text for the Clear button on the pop-up keypad for the numeric control specified by hWnd.

PPCtrl.KeypadClear(Num1)=”CLRL”

KeypadCancel

PPCtrl.KeypadCancel(hWnd)= str

Sets the text for the Cancel button on the pop-up keypad for the numeric control specified by hWnd.

PPCtrl.KeypadCancel(Num1)=”CNCL”

Numeric Keypad – Styles

ES_LEFT

Left aligns the text of the numeric control

ES_CENTER

Centre aligns the text of the numeric control.

ES_RIGHT

Right aligns the text of the numeric control.


Numeric Keypad - Constants

Const ES_READONLY = &H800 ' make the control read-only Const ES_LEFT = &H0 ' left align the text Const ES_CENTER = &H1 ' center align the text Const ES_RIGHT = &H2 ' right align the text Const PC_PLACEHOLDER = &H1000 ' use hWnd as a placeholder

Numeric Keypad - Example

Dim PPCtrl As Object Set PPCtrl = CreateObject("PPControl.Controls") Numeric = PPCtrl.NewNumeric(Text14.hWnd, PC_PLACEHOLDER + WS_BORDER + ES_CENTER) PPCtrl.prefix(Numeric) = "US$" PPCtrl.suffix(Numeric) = "%" PPCtrl.KeypadOK(Numeric) = "Ja" PPCtrl.KeypadCancel(Numeric) = "No" PPCtrl.KeypadClear(Numeric) = "New" PPCtrl.KeypadDelete(Numeric) = "Del" PPCtrl.Text(Numeric) = "123.45"