BCX_INPUT function
Purpose: BCX_INPUT creates a single line edit text box.
Syntax:
hCtl = BCX_INPUT(Text$, _
hWndParent, _
hCtlID%, _
Xpos%, _
Ypos%, _
Width%, _
Height% _
[,WinStyle%] _
[,ExWinStyle%])
Parameters:
- hCtl The return value is a handle to the new input box control
if the function succeeds. If the function fails, the return value is NULL.
- Text$ Default string to be placed in input box control.
- hWndParent Handle to the parent window of the input box control being created.
- hCtlID% Specifies the identifier of the input box control being created.
The identifier is an integer value used by the input box control being created
to notify its parent about events. The identifier must be unique for
each control created with the same parent window.
- Xpos% Specifies the initial horizontal position of the input box control being created.
X% is the x-coordinate of the upper-left corner of the input box control being created
relative to the upper-left corner of the parent window's client area.
- Ypos% Specifies the initial vertical position of the input box control being created.
Y% is the initial y-coordinate of the upper-left corner of the input box control being created
relative to the upper-left corner of the parent window's client area.
- Width% Specifies the width, in device units or, if the
PIXELS
optional parameter was specified in the
GUI statement,
in pixels , of the input box control
being created.
- Height% Specifies the height, in device units or, if the
PIXELS
optional parameter was specified in the
GUI statement,
in pixels , of the input box control
being created.
- WinStyle% [OPTIONAL] If the WinStyle% parameter is used,
the default Window Style for a BCX_INPUT control,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT, is replaced with
the value in WinStyle%. See your Win32 SDK or PSDK Reference help for more
information about valid Window Styles.
- ExWinStyle% [OPTIONAL] The default Extended Window Style for
a BCX_INPUT control is WS_EX_CLIENTEDGE. See your Win32 SDK or PSDK Reference
help for more information about valid Extended Window Styles.
|
Result: If the input box control was created, the return value is the handle to the new
input box control. If the function fails, the return value is NULL.
Remarks: The default window Style for a BCX_INPUT control
also can be changed by using the
MODSTYLE function.
Example:
GUI "BCX_INPUT"
GLOBAL form1 AS hwnd
GLOBAL inpbox1 AS hwnd
GLOBAL inpbox2 AS hwnd
GLOBAL message$ AS string
SUB formload
form1 = BCX_FORM("BCX_INPUT", 0, 0, 110, 50)
inpbox1 = BCX_INPUT("inpbox1", form1, 998, 8, 8, 94, 10)
inpbox2 = BCX_INPUT("inpbox2", form1, 999, 8, 20, 94, 10)
SHOW(form1)
END SUB
BEGIN EVENTS
SELECT CASE CBMSG
CASE WM_COMMAND
IF wParam = 1 AND
lParam = 0 THEN 'enter hit
IF GetFocus() = inpbox1 THEN
message$ = BCX_GET_TEXT$(inpbox1)
MSGBOX "inpbox1 has contents: " & message$
END IF
IF GetFocus() = inpbox2 THEN
message$ = BCX_GET_TEXT$(inpbox2)
MSGBOX "inpbox2 has contents: " & message$
END IF
END IF
END SELECT
END EVENTS
For another example of the BCX_INPUT function see
Amort.bas in the BCX\Gui_Demo\Amort folder.