• <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對象生成按鈕窗口時需要指明按鈕的風格。
            創建按鈕:BOOL CButton::Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );其中lpszCaption是按鈕上顯示的文字,dwStyle為按鈕風格,除了Windows風格可以使用外(如WS_CHILD|WS_VISUBLE|WS_BORDER)還有按鈕專用的一些風格。

            BS_AUTOCHECKBOX 檢查框,按鈕的狀態會自動改變 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 圓形選擇按鈕,按鈕的狀態會自動改變 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 允許按鈕有三種狀態即:選中,未選中,未定 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 允許按鈕有三種狀態即:選中,未選中,未定 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為窗口所占據的矩形區域,pParentWnd為父窗口指針,nID為該窗口的ID值。

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

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

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

            創建按鈕:BOOL CButton::Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );其中lpszCaption是按鈕上顯示的文字,dwStyle為按鈕風格,除了Windows風格可以使用外(如WS_CHILD|WS_VISUBLE|WS_BORDER)還有按鈕專用的一些風格。
            BS_AUTOCHECKBOX 檢查框,按鈕的狀態會自動改變 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 圓形選擇按鈕,按鈕的狀態會自動改變 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 允許按鈕有三種狀態即:選中,未選中,未定 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 允許按鈕有三種狀態即:選中,未選中,未定 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為窗口所占據的矩形區域,pParentWnd為父窗口指針,nID為該窗口的ID值。

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

            處理按鈕消息:要處理按鈕消息需要在父窗口中進行消息映射,映射宏為ON_BN_CLICKED( id, memberFxn )id為按鈕的ID值,就是創建時指定的nID值。處理函數原型為afx_msg void memberFxn( );
            Posted on 2005-11-08 19:04 艾凡赫 閱讀(870) 評論(0)  編輯 收藏 引用 所屬分類: MFC技術
            日本精品久久久中文字幕| 欧美精品久久久久久久自慰| 国产亚洲精久久久久久无码AV| 久久亚洲AV无码西西人体| 少妇无套内谢久久久久| 国产Av激情久久无码天堂| 伊人伊成久久人综合网777| 国内精品久久久久久久97牛牛| 久久精品中文字幕第23页| 久久久无码精品亚洲日韩蜜臀浪潮| 国产成人AV综合久久| 久久精品无码专区免费青青| 久久99精品久久久久久9蜜桃| 久久久久AV综合网成人| 亚洲国产视频久久| 精品99久久aaa一级毛片| 97久久香蕉国产线看观看| 精品久久久一二三区| 久久露脸国产精品| 成人免费网站久久久| 色狠狠久久AV五月综合| 久久精品免费全国观看国产| 久久亚洲国产精品123区| 久久91亚洲人成电影网站| 久久久久久亚洲Av无码精品专口| 久久99这里只有精品国产| 久久人搡人人玩人妻精品首页| 国产亚洲成人久久| 国内精品伊人久久久久影院对白| 色综合久久久久| 伊人色综合久久天天| 精品久久久久久无码免费| 久久久久97国产精华液好用吗| 国产午夜福利精品久久| 久久婷婷人人澡人人| 亚洲精品国精品久久99热| 久久青青色综合| 久久九九精品99国产精品| 2021久久国自产拍精品| 久久精品中文字幕久久| 国产成人综合久久精品尤物|