BCX_PRINT function

Purpose: The BCX_PRINT function writes at the specified X%(horizontal) Y%(vertical) location, a text string. The currently selected font, background color, and text color are used.


 Syntax:

 RetVal% = BCX_PRINT(hWnd, _
                     Xpos%, _
                     Ypos%, _
                     Text$  _
                [, DrawHDC])

 Parameters:

  • RetVal% Nonzero integer if the function succeeds, zero if the function fails.
  • hWnd Identifies the window where printing takes place.
  • Xpos% X-coordinate(horizontal) of the position.
  • Ypos% Y-coordinate(vertical) of the position.
  • Text$ String literal or variable to be printed.
  • DrawHDC [OPTIONAL] HDC(Handle to Device Context) pointing to an already open HDC. This is useful if a device context is to be written to many times. In this case the programmer is responsible for closing the HDC at the appropriate time.

Example:


 GUI "BCX_PRINT"

 SUB FORMLOAD
 GLOBAL Form1 AS HWND

 Form1 = BCX_FORM("BCX_PRINT", 0, 0, 90, 25)
 BCX_SET_FORM_COLOR(Form1,RGB(255,255,255))
 CENTER(Form1)
 SHOW(Form1)
 END SUB

 BEGIN EVENTS
 SELECT CASE CBMSG
    CASE WM_PAINT
    BCX_PRINT(Form1, 10, 10, "Hello World from BCX!")
 END SELECT
 END EVENTS