A static control displays a text string, box, rectangle, icon, cursor, bitmap, or enhanced metafile. It is represented by CStatic class. It can be used to label, box, or separate other controls. A static control normally takes no input and provides no output.
Here is the list of methods in CStatic class −
|Sr.No.||Name & Description|
Creates the Windows static control and attaches it to the CStatic object.
Override to draw an owner-drawn static control.
Retrieves the handle of the bitmap previously set with SetBitmap.
Retrieves the handle of the cursor image previously set with SetCursor.
Retrieves the handle of the enhanced metafile previously set with SetEnhMetaFile.
Retrieves the handle of the icon previously set with SetIcon.
Specifies a bitmap to be displayed in the static control.
Specifies a cursor image to be displayed in the static control.
Specifies an enhanced metafile to be displayed in the static control.
Specifies an icon to be displayed in the static control.
Let us look into a simple example of Static Text.
Step 1 − Drag a Static Text control from Toolbox.
Step 2 − Change the Caption to It is Static Text Control and run your application you will see the following dialog box, which now contains the Static Text control as well.