Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C++
MFC
MFC Classes
CStatic Class

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
MFC Library Reference
CStatic Class

Provides the functionality of a Windows static control.

class CStatic : public CWnd

A static control displays a text string, box, rectangle, icon, cursor, bitmap, or enhanced metafile. It can be used to label, box, or separate other controls. A static control normally takes no input and provides no output; however, it can notify its parent of mouse clicks if it's created with SS_NOTIFY style.

Create a static control in two steps. First, call the constructor to construct the CStatic object, then call the Create member function to create the static control and attach it to the CStatic object.

If you create a CStatic object within a dialog box (through a dialog resource), the CStatic object is automatically destroyed when the user closes the dialog box.

If you create a CStatic object within a window, you may also need to destroy it. A CStatic object created on the stack within a window is automatically destroyed. If you create the CStatic object on the heap by using the new function, you must call delete on the object to destroy it when the you are done with it.

Header: afxwin.h

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker