BCX_GET_TEXT$ function

Purpose:

BCX_GET_TEXT$ will get text from the edit or static text field of a control.

Syntax:

RetStr = BCX_GET_TEXT$(HndlWnd AS HWND)

Return Value:

  • Data type: STRING
    RetStr Text string returned from the edit field or control.

Parameters:

  • Data type: HWND
    HndlWnd The handle of the edit control from which to get the text.

Example:

GUI "BCX_Password"

MACRO Text_ID = 100
MACRO Butt_ID = 101

GLOBAL Form1  AS HWND
GLOBAL Input1 AS HWND
GLOBAL Butt1  AS HWND

SUB FORMLOAD
  Form1  = BCX_FORM (" Password ", 0, 0, 120, 50)
  Input1 = BCX_INPUT("BCX IS GREAT!" , Form1, Text_ID, 20, 6, 80, 12)
  Butt1  = BCX_BUTTON(" View Password" , Form1, Butt_ID, 20, 20)
  SendMessage(Input1, EM_SETPASSWORDCHAR, 42, 0) ' 42 = Windows Code Page code point for "*" 
  SetFocus(Input1)
  CENTER (Form1)
  SHOW    (Form1)
END SUB

BEGIN EVENTS
  SELECT CASE CBMSG
    '********************** 
  CASE WM_COMMAND
    '********************** 
    LOCAL T$
    IF CBCTL = Butt_ID THEN
      T$ = BCX_GET_TEXT$(Input1)
      MSGBOX T$
    END IF
  END SELECT
END EVENTS

For other examples of the BCX_GET_TEXT$ function see BCX\Gui_Demo\Amort\Amort.bas and BCX\Gui_Demo\Calc\Calc.bas.