CText Control

Purpose

Creates a centered-text static control in the current active form, window, or dialog.

Syntax

CText text$, id%, x, y, width, height[, style%]

text$:control text
id%:control identifier
x,y,b,h:iexp
style%:the control styles

Description

The control is a simple rectangle displaying the given text centered in the rectangle. The text is formatted before it is displayed. Words that would extend past the end of a line are automatically wrapped to the beginning of the next line.

style Specifies the control styles. This value can be any combination of the following styles: SS_CENTER, WS_TABSTOP, and WS_GROUP. If you do not specify a style, the default style is SS_CENTER | WS_GROUP.

Creates a control without an OCX wrapper; so it and cannot be handled using properties, methods, and event subs. When used in a form the WM_COMMAND and WM_NOTIFY messages should be handled in the form's _MessageProc sub.

Example

CText "Filename", 101, 10, 10, 100, 100

creates a centered-text control that is labeled 'Filename'.

Remarks

This command is particular useful for a dialog box in a GLL, because a GLL doesn't support OCX controls.

With the general Control statement any control type can be created.

See Also

Control, AnimateCtrl, AutoCheckBox, AutoRadioButton, CheckBox, ComboBox, CText, Dialog, DefPushButton, EditText, GroupBox, HeaderCtrl, ListBox, ListViewCtrl, LText, ProgressCtrl, PushButton, RadioButton, RichEditCtrl, RText, ScrollBar, StatusCtrl, TabCtrl, ToolBarCtrl, TrackBarCtrl, TreeViewCtrl, UpDownCtrl

{Created by Sjouke Hamstra; Last updated: 27/09/2014 by James Gaite}