;
帖子
3919 
精华
积分
11710 
鱼币
0 ¥ 
来自
大连 
在线时间
1858 小时 
注册时间
2007-6-11 
最后登录
2009-10-20 

贴图大师勋章新人进步勋章宣传大使勋章论坛元老勋章

3
发表于 2009-1-5 19:48 | 只看该作者
VC++涔婤utton鎺т欢 - 缂栫▼搴 - Powered by SupeSite

浣犵殑浣嶇疆锛缂栫▼搴 >> 璧勮 >> VC >> vc鎺т欢 >> 璇︾粏鍐呭 鍦ㄧ嚎鎶曠ǹ

VC++涔婤utton鎺т欢

鍙戝竷: 2008-6-26 14:28 |  浣滆: admin |   鏌ョ湅: 206娆

鎸夐挳绐楀彛锛堟帶浠讹級鍦∕FC涓娇鐢–Button琛ㄧず锛孋Button鍖呭惈浜嗕笁绉嶆牱寮忕殑鎸夐挳锛孭ush Button锛孋heck Box锛孯adio Box銆傛墍浠ュ湪鍒╃敤CButton瀵硅薄鐢熸垚鎸夐挳绐楀彛鏃堕渶瑕佹寚鏄庢寜閽殑椋庢牸銆

鍒涘缓鎸夐挳锛欱OOL CButton::Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );鍏朵腑lpszCaption鏄寜閽笂鏄剧ず鐨勬枃瀛楋紝dwStyle涓烘寜閽鏍硷紝闄や簡Windows椋庢牸鍙互浣跨敤澶栵紙濡俉S_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涓虹獥鍙f墍鍗犳嵁鐨勭煩褰㈠尯鍩燂紝pParentWnd涓虹埗绐楀彛鎸囬拡锛宯ID涓鸿绐楀彛鐨処D鍊笺

鑾峰彇/鏀瑰彉鎸夐挳鐘舵侊細瀵逛簬妫鏌ユ寜閽拰鍦嗗舰鎸夐挳鍙兘鏈変袱绉嶇姸鎬侊紝閫変腑鍜屾湭閫変腑锛屽鏋滆缃簡BS_3STATE鎴朆S_AUTO3STATE椋庢牸灏卞彲鑳藉嚭鐜扮涓夌鐘舵侊細鏈畾锛岃繖鏃舵寜閽樉绀虹伆鑹层傞氳繃璋冪敤int CButton::GetCheck( ) 寰楀埌褰撳墠鏄惁琚変腑锛岃繑鍥0锛氭湭閫変腑锛1锛氶変腑锛2锛氭湭瀹氥傝皟鐢╲oid CButton::SetCheck( int nCheck );璁剧疆褰撳墠閫変腑鐘舵併

澶勭悊鎸夐挳娑堟伅锛氳澶勭悊鎸夐挳娑堟伅闇瑕佸湪鐖剁獥鍙d腑杩涜娑堟伅鏄犲皠锛屾槧灏勫畯涓篛N_BN_CLICKED( id, memberFxn )id涓烘寜閽殑ID鍊硷紝灏辨槸鍒涘缓鏃舵寚瀹氱殑nID鍊笺傚鐞嗗嚱鏁板師鍨嬩负afx_msg void memberFxn( );

鎸夐挳绐楀彛锛堟帶浠讹級鍦∕FC涓娇鐢–Button琛ㄧず锛孋Button鍖呭惈浜嗕笁绉嶆牱寮忕殑鎸夐挳锛孭ush Button锛孋heck Box锛孯adio Box銆傛墍浠ュ湪鍒╃敤CButton瀵硅薄鐢熸垚鎸夐挳绐楀彛鏃堕渶瑕佹寚鏄庢寜閽殑椋庢牸銆

鍒涘缓鎸夐挳锛欱OOL CButton::Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );鍏朵腑lpszCaption鏄寜閽笂鏄剧ず鐨勬枃瀛楋紝dwStyle涓烘寜閽鏍硷紝闄や簡Windows椋庢牸鍙互浣跨敤澶栵紙濡俉S_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).

鎵撳嵃 | 鏀惰棌姝ら〉 |  鎺ㄨ崘缁欏ソ鍙 | 涓炬姤
涓婁竴绡 涓嬩竴绡
 

璇勫垎锛0

鍙戣〃璇勮
鏌ョ湅鍏ㄩ儴鍥炲銆愬凡鏈0浣嶇綉鍙嬪彂琛ㄤ簡鐪嬫硶銆