| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Displays a box on the screen.
DispBox( <nTop>, <nLeft>, <nBottom>, <nRight>, ;
[<cnBoxString>] , [<cColor>] ) --> NIL
Pre-defined box strings for DispBox()
| Constant | Description |
|---|---|
| B_SINGLE | Single-line box |
| B_DOUBLE | Double-line box |
| B_SINGLE_DOUBLE | Single-line top, double-line sides |
| B_DOUBLE_SINGLE | Double-line top, single-line sides |
If no <cnBoxString> is specified, a single-line box is drawn.
The return value is always NIL.
The function DispBox() displays a box on the screen as specified with <cnBoxString>, using the standard color of SetColor() or <cColor>, if specified.
If a character string is used for <cnBoxString>, the first eight characters define the border of the box in clockwise direction, beginning with the upper left corner. An optional ninth character fills the area inside the box. Alternatively, a single character can be passed which is used to draw the entire box border.
When the box is completely drawn, the cursor is positioned at the coordinates <nTop>+1 and <nLeft>+1, so that a subsequent DispOut() call starts displaying in the upper left corner of the box area.
| See also: | @...BOX, @...CLEAR, @...TO, Scroll(), SetColor() |
| Category: | Screen functions |
| Header: | box.ch |
| Source: | rtl\box.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example demonstrates how characters are used to draw a box.
// Alphabetic characters define <cnBoxString> instead of characters
// holding graphic signs.
#include "Box.ch"
PROCEDURE Main
CLS
DispBox( 10,10,20,50, "AbCdEfGhi", "W+/R" )
Inkey(0)
DispBox( 10,10,20,50, B_DOUBLE + Space(1) )
DispOut( "Using #define constant" )
@ MaxRow(),0
RETURN
http://www.xHarbour.com