请问如何更改Button的颜色?(不是字体的)

解决方案 »

  1.   

    使用第三方控件,如1StClass的,具有这种功能,还可以改变形状
      

  2.   

    The WM_CTLCOLORBTN message is sent to the parent window of a button when the button is about to be drawn. By responding to this message, the parent window can set a button's text and background colors. WM_CTLCOLORBTN  
    hdcButton = (HDC) wParam;   // handle of button display context 
    hwndButton = (HWND) lParam; // handle of button 
     ParametershdcButtonValue of wParam. Identifies the display context for the button. hwndButtonValue of lParam. Identifies the button.  Return ValuesIf an application processes this message, it must return the handle of a brush. Windows uses the brush to paint the background of the button. Default ActionThe DefWindowProc function selects the default system colors for the button. ResThe WM_CTLCOLORBTN message is never sent between threads. It is sent only within one thread. 
    The text color of a check box or radio button applies to the box or button, its check , and the text. The focus rectangle for these buttons remains the system default color (typically black). The text color of a group box applies to the text but not to the line that defines the box. The text color of a push button applies only to its focus rectangle; it does not affect the color of the text. 
      

  3.   

    可以用SpeedButton,通过加载各种颜色的图片实现;现在很多第三方控件有这种按钮。
      

  4.   

    兄弟们!俺kingcom_xu又回来啦! 虽然俺以前帮过你们不少忙,可是这次你们一定要批评我,不要客气,我,我...我生了个私生子,叫21bird...
      

  5.   

    这个问题已经问过无数次了,
    到我的主页上去,有一个完整的示例,多年前在电脑报上发表。
    www.netgocn.com