VC++ Button Styles Window Styles

本文详细介绍了在VC++中创建和使用CButton对象的步骤,包括如何应用WS_VISIBLE等窗口样式来显示和激活按钮。同时,列举了多种不同类型的按钮样式,如BS_3STATE、BS_AUTOCHECKBOX等,以及它们各自的功能和应用场景。此外,还提到了窗口样式的应用,如WS_BORDER用于创建带边框的窗口,WS_GROUP用于组内控件的导航。

目录

Button Styles:

Window Styles:

接上: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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

米酒馆

鼓励鼓励,鼓励很重要啦~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值