• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            按鈕窗口(控件)在MFC中使用CButton表示,CButton包含了三種樣式的按鈕,Push Button,Check Box,Radio Box。所以在利用CButton對象生成按鈕窗口時需要指明按鈕的風格。
            創(chuàng)建按鈕:BOOL CButton::Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );其中l(wèi)pszCaption是按鈕上顯示的文字,dwStyle為按鈕風格,除了Windows風格可以使用外(如WS_CHILD|WS_VISUBLE|WS_BORDER)還有按鈕專用的一些風格。

            BS_AUTOCHECKBOX 檢查框,按鈕的狀態(tài)會自動改變 Same as a check box, except that a check mark appears in the check box when the user selects the box; the check mark disappears the next time the user selects the box.

            BS_AUTORADIOBUTTON 圓形選擇按鈕,按鈕的狀態(tài)會自動改變 Same as a radio button, except that when the user selects it, the button automatically highlights itself and removes the selection from any other radio buttons with the same style in the same group.

            BS_AUTO3STATE 允許按鈕有三種狀態(tài)即:選中,未選中,未定 Same as a three-state check box, except that the box changes its state when the user selects it.

            BS_CHECKBOX 檢查框 Creates a small square that has text displayed to its right (unless this style is combined with the BS_LEFTTEXT style).

            BS_DEFPUSHBUTTON 默認普通按鈕 Creates a button that has a heavy black border. The user can select this button by pressing the ENTER key. This style enables the user to quickly select the most likely option (the default option).

            BS_LEFTTEXT 左對齊文字 When combined with a radio-button or check-box style, the text appears on the left side of the radio button or check box.

            BS_OWNERDRAW 自繪按鈕 Creates an owner-drawn button. The framework calls the DrawItem member function when a visual aspect of the button has changed. This style must be set when using the CBitmapButton class.

            BS_PUSHBUTTON 普通按鈕 Creates a pushbutton that posts a WM_COMMAND message to the owner window when the user selects the button.

            BS_RADIOBUTTON 圓形選擇按鈕 Creates a small circle that has text displayed to its right (unless this style is combined with the BS_LEFTTEXT style). Radio buttons are usually used in groups of related but mutually exclusive choices.

            BS_3STATE 允許按鈕有三種狀態(tài)即:選中,未選中,未定 Same as a check box, except that the box can be dimmed as well as checked. The dimmed state typically is used to show that a check box has been disabled.
            rect為窗口所占據(jù)的矩形區(qū)域,pParentWnd為父窗口指針,nID為該窗口的ID值。

            獲取/改變按鈕狀態(tài):對于檢查按鈕和圓形按鈕可能有兩種狀態(tài),選中和未選中,如果設置了BS_3STATE或BS_AUTO3STATE風格就可能出現(xiàn)第三種狀態(tài):未定,這時按鈕顯示灰色。通過調(diào)用int CButton::GetCheck( ) 得到當前是否被選中,返回0:未選中,1:選中,2:未定。調(diào)用void CButton::SetCheck( int nCheck );設置當前選中狀態(tài)。

            處理按鈕消息:要處理按鈕消息需要在父窗口中進行消息映射,映射宏為ON_BN_CLICKED( id, memberFxn )id為按鈕的ID值,就是創(chuàng)建時指定的nID值。處理函數(shù)原型為afx_msg void memberFxn( );

            按鈕窗口(控件)在MFC中使用CButton表示,CButton包含了三種樣式的按鈕,Push Button,Check Box,Radio Box。所以在利用CButton對象生成按鈕窗口時需要指明按鈕的風格。

            創(chuàng)建按鈕:BOOL CButton::Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );其中l(wèi)pszCaption是按鈕上顯示的文字,dwStyle為按鈕風格,除了Windows風格可以使用外(如WS_CHILD|WS_VISUBLE|WS_BORDER)還有按鈕專用的一些風格。
            BS_AUTOCHECKBOX 檢查框,按鈕的狀態(tài)會自動改變 Same as a check box, except that a check mark appears in the check box when the user selects the box; the check mark disappears the next time the user selects the box.

            BS_AUTORADIOBUTTON 圓形選擇按鈕,按鈕的狀態(tài)會自動改變 Same as a radio button, except that when the user selects it, the button automatically highlights itself and removes the selection from any other radio buttons with the same style in the same group.

            BS_AUTO3STATE 允許按鈕有三種狀態(tài)即:選中,未選中,未定 Same as a three-state check box, except that the box changes its state when the user selects it.

            BS_CHECKBOX 檢查框 Creates a small square that has text displayed to its right (unless this style is combined with the BS_LEFTTEXT style).

            BS_DEFPUSHBUTTON 默認普通按鈕 Creates a button that has a heavy black border. The user can select this button by pressing the ENTER key. This style enables the user to quickly select the most likely option (the default option).

            BS_LEFTTEXT 左對齊文字 When combined with a radio-button or check-box style, the text appears on the left side of the radio button or check box.

            BS_OWNERDRAW 自繪按鈕 Creates an owner-drawn button. The framework calls the DrawItem member function when a visual aspect of the button has changed. This style must be set when using the CBitmapButton class.

            BS_PUSHBUTTON 普通按鈕 Creates a pushbutton that posts a WM_COMMAND message to the owner window when the user selects the button.

            BS_RADIOBUTTON 圓形選擇按鈕 Creates a small circle that has text displayed to its right (unless this style is combined with the BS_LEFTTEXT style). Radio buttons are usually used in groups of related but mutually exclusive choices.

            BS_3STATE 允許按鈕有三種狀態(tài)即:選中,未選中,未定 Same as a check box, except that the box can be dimmed as well as checked. The dimmed state typically is used to show that a check box has been disabled.
            rect為窗口所占據(jù)的矩形區(qū)域,pParentWnd為父窗口指針,nID為該窗口的ID值。

            獲取/改變按鈕狀態(tài):對于檢查按鈕和圓形按鈕可能有兩種狀態(tài),選中和未選中,如果設置了BS_3STATE或BS_AUTO3STATE風格就可能出現(xiàn)第三種狀態(tài):未定,這時按鈕顯示灰色。通過調(diào)用int CButton::GetCheck( ) 得到當前是否被選中,返回0:未選中,1:選中,2:未定。調(diào)用void CButton::SetCheck( int nCheck );設置當前選中狀態(tài)。

            處理按鈕消息:要處理按鈕消息需要在父窗口中進行消息映射,映射宏為ON_BN_CLICKED( id, memberFxn )id為按鈕的ID值,就是創(chuàng)建時指定的nID值。處理函數(shù)原型為afx_msg void memberFxn( );
            Posted on 2005-11-08 19:04 艾凡赫 閱讀(882) 評論(0)  編輯 收藏 引用 所屬分類: MFC技術
            久久久久免费精品国产| 亚洲国产精品无码久久久蜜芽| 精品国产一区二区三区久久久狼| 国产成人久久精品一区二区三区| 天堂久久天堂AV色综合| 国内精品人妻无码久久久影院| 99久久伊人精品综合观看| 亚洲国产精品综合久久一线| 日日躁夜夜躁狠狠久久AV| 欧美综合天天夜夜久久| 99精品国产免费久久久久久下载| 久久久久人妻一区二区三区vr| 久久91这里精品国产2020| 色综合久久久久无码专区| 国产精品免费看久久久香蕉| 国产偷久久久精品专区| 国产精品九九久久免费视频| 久久青青草原精品国产| 久久天天躁狠狠躁夜夜不卡| 国内精品久久久久久野外| 久久精品国产久精国产果冻传媒 | 久久精品无码一区二区日韩AV| 久久天天躁狠狠躁夜夜avapp| 91精品国产91久久久久久青草| 综合久久国产九一剧情麻豆| 久久久黄片| 国产精品成人精品久久久| 精品亚洲综合久久中文字幕| 亚洲精品美女久久777777| 日日狠狠久久偷偷色综合96蜜桃| 狠狠色噜噜狠狠狠狠狠色综合久久| 久久综合九色综合网站| 老司机午夜网站国内精品久久久久久久久 | 久久综合九色综合精品| 国产午夜福利精品久久2021| 亚洲av成人无码久久精品| 亚洲愉拍99热成人精品热久久| 久久乐国产综合亚洲精品| 热99RE久久精品这里都是精品免费 | 久久综合精品国产一区二区三区 | 99久久人妻无码精品系列蜜桃|