void CKkkyDlg::OnButton1()
{
// TODO: Add your control notification handler code here
m_xx.Set
}
打算在这个函数实现.设置了一个变量m_xx和Button1关联,不过发现没有改变背景颜色或字体颜色的方法.如何实现这些功能啊,以前见过的,现在不知道怎么做了!我也是才刚开始学VC........VC很难,比C++BUILDER难N倍.谢谢
...全文
10814打赏收藏
如何实现点击按钮,然后改变按钮背景色...
void CKkkyDlg::OnButton1() { // TODO: Add your control notification handler code here m_xx.Set } 打算在这个函数实现.设置了一个变量m_xx和Button1关联,不过发现没有改变背景颜色或字体颜色的方法.如何实现这些功能啊,以前见过的,现在不知道怎么做了!我也是才刚开始学VC........VC很难,比C++BUILDER难N倍.谢谢
HBRUSH CZilchDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// Call the base class implementation first! Otherwise, it may
// undo what we are trying to accomplish here.
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// Are we painting the IDC_MYSTATIC control? We can use
// CWnd::GetDlgCtrlID() to perform the most efficient test.
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
// Set the text color to red.
pDC->SetTextColor(RGB(255, 0, 0));
// Set the background mode for text to transparent
// so background will show thru.
pDC->SetBkMode(TRANSPARENT);