目录
接上:VC++在窗口中显示按钮 CButton::Create Button Styles Window Styles
接下:VC++简单绘图 MFC消息映射机制 MessageBox函数
You construct a CButton object in two steps. First, call the constructor and then call Create, which creates the Windows button control and attaches it to the CButton object.
If the WS_VISIBLE style is given, Windows sends the button control all the messages required to activate and show the button.
Apply the following window styles to a button control:
用两个步骤构造一个CButton对象。首先,调用构造函数,然后调用Create(创建Windows按钮控件并将其附加到CButton对象)。
如果给出了WS_VISIBLE样式,Windows将向按钮控件发送激活和显示按钮所需的所有消息。
在按钮控件上应用以下窗口样式:
WS_CHILD Always
WS_VISIBLE Usually
WS_DISABLED Rarely
WS_GROUP To group controls
WS_TABSTOP To include the button in the tabbing order
Button Styles:
Type |
Description |
---|---|
BS_3STATE |
Creates a check box button with three states: BST_CHECKED, BST_INDETERMINATE, and BST_UNCHECKED. Clicking on the button sends a BN_CLICKED notification to the owner window but does not change the state of the button. By default, associated text is displayed to the right of the check box. To display text to the left of the check box, use the BS_LEFTTEXT or BS_RIGHTBUTTON style. |
BS_AUTO3STATE |
Creates a check box button with three states: BST_CHECKED, BST_INDETERMINATE, and BST_UNCHECKED. Clicking on the button sends a BN_CLICKED notification to the owner window and changes the state of the button. The button states cycle in the order of BST_CHECKED, BST_INDETERMINATE, and BST_UNCHECKED. By default, associated text is displayed to the right of the check box. To display text to the left of the check box, use the BS_LEFTTEXT or BS_RIGHTBUTTON style. |
BS_AUTOCHECKBOX |
Creates a check box button with two states: BST_CHECKED and BST_UNCHECKED. Clicking on the button sends a BN_CLICKED notification to the owner window and changes the state of the button. By default, associated text is displayed to the right of the check box. To display text to the |