VC++ Button Styles Window Styles
来源:http://www.tudoupe.com时间:2022-05-06
目录
Button Styles:
Window Styles:
回答: 按钮在窗口中显示为 VC++。 CButton: 构建按钮样式窗口样式
在此之后, 我们将查看 VC++ 基本绘图 MFC 消息MapMapMatchBox 方法 。
You construct a CButton object in two steps. First, call theconstructorand then callCreate, which creates the Windowsbutton controland 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 对象 : 首先, 调用构建函数, 然后创建( 建立 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 left of the check box, use the BS_LEFTTEXT or BS_RIGHTBUTTON style. |
BS_AUTORADIOBUTTON |
Creates a radio button with two states: BST_CHECKED and BST_UNCHECKED. Radio buttons are usually used in groups, with each group having a maximum of one checked option at a time. Clicking on the button sends a BN_CLICKED notification to the owner window, sets the state of the clicked radio button to BST_CHECKED, and sets the states of all other radio buttons in the button group to BST_UNCHECKED. By default, associated text is displayed to the right of the radio button. To display text to the left of the radio button, use the BS_LEFTTEXT or BS_RIGHTBUTTON style. |
BS_CHECKBOX |
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 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_COMMANDLINK |
Creates a command link button. A command link button is a command button specific to Windows Vista that displays a green arrow to the left of the main text and a note below the main text. You can set the note text using CButton::SetNote. |
BS_DEFCOMMANDLINK |
Creates a command link button. A command link button is a command button specific to Windows Vista that displays a green arrow to the left of the main text and a note below the main text. You can set the note text using CButton::SetNote. If the button is in a dialog box, pressing the ENTER key sends a BN_CLICKED notification to the dialog box even when the button does not have the input focus. |
BS_DEFPUSHBUTTON |
Creates a command button that has a heavy black border. If the button is in a dialog box, pressing the ENTER key sends a BN_CLICKED notification to the dialog box even when the button does not have the input focus. |
BS_DEFSPLITBUTTON |
Creates a split button. A split button is a command button specific to Windows Vista that contains a button adjacent to a drop-down arrow. When you click the button, the default command is executed. When you click the drop-down arrow, a menu of additional commands appears. If the split button is in a dialog box, pressing the ENTER key sends a BN_CLICKED notification to the dialog box even when the button does not have the input focus |
BS_GROUPBOX |
Creates a rectangle in which other buttons can be grouped. Text associated with this style is displayed in the rectangle's upper-left corner. |
BS_OWNERDRAW |
Creates an owner-drawn button. The framework calls the DrawItem method when a visual aspect of the button has changed. This style must be set when you use the CBitmapButton class. |
BS_PUSHBUTTON |
Creates a command button that sends a BN_CLICKED notification to the owner window when the user clicks the button. |
BS_RADIOBUTTON |
Creates a radio button with two states: BST_CHECKED and BST_UNCHECKED. Radio buttons are usually used in groups, with each group having a maximum of one checked option at a time. Clicking on the button sends a BN_CLICKED notification to the owner window but does not automatically change the state of any button in the group. By default, associated text is displayed to the right of the radio button. To display text to the left of the radio button, use the BS_LEFTTEXT or BS_RIGHTBUTTON style. |
BS_SPLITBUTTON |
Creates a split button. A split button is a command button specific to Windows Vista that contains a button adjacent to a drop-down arrow. When you click the button, the default command is executed. When you click the drop-down arrow, a menu of additional commands appears. |
BS_USERBUTTON |
Obsolete, but provided for compatibility with 16-bit versions of Windows. Win32-based applications should use BS_OWNERDRAW instead. |
Window Styles:
WS_BORDER Creates a window that has a border.
WS_CAPTION Creates a window that has a title bar (implies the WS_BORDER style). Cannot be used with the WS_DLGFRAME style.
WS_CHILD Creates a child window. Cannot be used with the WS_POPUP style.
WS_CHILDWINDOW Same as the WS_CHILD style.
WS_CLIPCHILDREN Excludes the area occupied by child windows when you draw within the parent window. Used when you create the parent window.
WS_CLIPSIBLINGS Clips child windows relative to each other; that is, when a particular child window receives a paint message, the WS_CLIPSIBLINGS style clips all other overlapped child windows out of the region of the child window to be updated. (If WS_CLIPSIBLINGS is not given and child windows overlap, when you draw within the client area of a child window, it is possible to draw within the client area of a neighboring child window.) For use with the WS_CHILD style only.
WS_DISABLED Creates a window that is initially disabled.
WS_DLGFRAME Creates a window with a double border but no title.
WS_GROUP Specifies the first control of a group of controls in which the user can move from one control to the next with the arrow keys. All controls defined with the WS_GROUP style FALSE after the first control belong to the same group. The next control with the WS_GROUP style starts the next group (that is, one group ends where the next begins).
WS_HSCROLL Creates a window that has a horizontal scroll bar.
WS_ICONIC Creates a window that is initially minimized. Same as the WS_MINIMIZE style.
WS_MAXIMIZE Creates a window of maximum size.
WS_MAXIMIZEBOX Creates a window that has a Maximize button.
WS_MINIMIZE Creates a window that is initially minimized. For use with the WS_OVERLAPPED style only.
WS_MINIMIZEBOX Creates a window that has a Minimize button.
WS_OVERLAPPED Creates an overlapped window. An overlapped window usually has a caption and a border.
WS_OVERLAPPEDWINDOW Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles.
WS_POPUP Creates a pop-up window. Cannot be used with the WS_CHILD style.
WS_POPUPWINDOW Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style must be combined with the WS_POPUPWINDOW style to make the Control menu visible.
WS_SIZEBOX Creates a window that has a sizing border. Same as the WS_THICKFRAME style.
WS_SYSMENU Creates a window that has a Control-menu box in its title bar. Used only for windows with title bars.
WS_TABSTOP Specifies one of any number of controls through which the user can move by using the TAB key. The TAB key moves the user to the next control specified by the WS_TABSTOP style.
WS_THICKFRAME Creates a window with a thick frame that can be used to size the window.
WS_TILED Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPEDstyle.
WS_TILEDWINDOW Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_OVERLAPPEDWINDOW style.
WS_VISIBLE Creates a window that is initially visible.
WS_VSCROLL Creates a window that has a vertical scroll bar.
C button: 在窗口中构建按钮样式 Windows VC++ 显示按钮
在此之后, 我们将查看 VC++ 基本绘图 MFC 消息MapMapMatchBox 方法 。
相关新闻
- 2022-08-04 WPF的由来
- 2022-08-04 Win11勒索软件防护怎么打开?Win11安
- 2022-08-04 Windows系统jdk的配置
- 2022-08-04 Windows10 OneNote怎么重新登录?如何重
- 2022-08-04 超好用的 Windows 效率工具推荐
- 2022-08-04 Windows如何在CMD或PowerShell中配置代理
- 2022-08-04 powershell和cmd对比
- 2022-08-04 【QT】Windows下QT下载安装
- 2022-08-04 windows下 C++ 实现类属性的get和set方
- 2022-08-04 Win11快速助手在哪里?Win11打开快速
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
