BCX_EDIT function

Purpose: BCX_EDIT creates a multiline Edit control with auto-scrolling and a vertical scrollbar.


 Syntax:

 hCtl = BCX_EDIT(Text$, _
             hWndParent, _
                hCtlID%, _
                  Xpos%, _
                  Ypos%, _
                 Width%, _
                Height%  _
            [,WinStyle%] _
          [,ExWinStyle%])

 Parameters:

  • hCtl The return value is a handle to the new control if the function succeeds. If the function fails, the return value is NULL.
  • Text$ Default string to be placed in Edit box.
  • hWndParent Handle to the parent window of the control being created.
  • hCtlID% Specifies the identifier of the control being created. The identifier is an integer value used by the 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 control being created. X% is the x-coordinate of the upper-left corner of the control being created relative to the upper-left corner of the parent window's client area.
  • Ypos% Specifies the initial vertical position of the control being created. Y% is the initial y-coordinate of the upper-left corner of the 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 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 control being created.
  • WinStyle% [OPTIONAL] If the WinStyle% parameter is used, the default Window Style for a BCX_EDIT control, WS_CHILD | WS_VISIBLE | ES_WANTRETURN | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL, 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_EDIT control is WS_EX_CLIENTEDGE. See your Win32 SDK or PSDK Reference help for more information about valid Extended Window Styles.

Remarks: To tab forward out of the BCX_TAB control use the CTRL-TAB key combination.

The default window Style for a BCX_EDIT control also can be changed by using the MODSTYLE function.

The following example uses the MODSTYLE function to add a horizontal scrollbar to the edit control.


 GUI "BCX_Edit"

 SUB FORMLOAD
  DIM Form1 AS CONTROL
  DIM Edit1 AS CONTROL
  Form1 = BCX_FORM("BCX_Edit", 0, 0, 110, 110)
  Edit1 = BCX_EDIT("Start Typing And Watch The ScrollBars",Form1,12345,0,0,110,105)
  MODSTYLE(Edit1,WS_HSCROLL)
  CENTER(Form1)
  SHOW(Form1)
 END SUB

 BEGIN EVENTS
 END EVENTS

For another example using the BCX_EDIT function see Demo.bas in the BCX\Gui_Demo\EZ_Gui folder.