2008年(884)
分类: C/C++
2008-08-06 09:53:43
m_OK.OffsetColor(CButtonST::BTNST_COLOR_BK_IN, 30); m_OK.SetBkColor(RGB(162,189,252)); m_OK.SetRounded(TRUE); m_OK.SetTooltipText(_T("关闭"));6、在CAboutDlg::OnCtlColor中加入如下代码:
if(nCtlColor==CTLCOLOR_LISTBOX) { //pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(RGB(0,0,0)); pDC->SetBkColor(RGB(233,233,220)); HBRUSH b=CreateSolidBrush(RGB(233,233,220)); return b; } else if(nCtlColor==CTLCOLOR_SCROLLBAR) { //pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(RGB(0,0,0)); pDC->SetBkColor(RGB(233,233,220)); HBRUSH b=CreateSolidBrush(RGB(233,233,220)); return b; } else if(nCtlColor==CTLCOLOR_EDIT) { //pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(RGB(0,0,0)); pDC->SetBkColor(RGB(233,233,220)); HBRUSH b=CreateSolidBrush(RGB(233,233,220)); return b; } else if(nCtlColor==CTLCOLOR_STATIC) { pDC->SetTextColor(RGB(0,0,0)); pDC->SetBkColor(RGB(160,180,220)); HBRUSH b=CreateSolidBrush(RGB(160,180,220)); return b; } else if(nCtlColor==CTLCOLOR_DLG) { pDC->SetTextColor(RGB(0,0,0)); pDC->SetBkColor(RGB(160,180,220)); HBRUSH b=CreateSolidBrush(RGB(160,180,220)); return b; }7、在CAboutDlg::DoDataExchange中加入如下代码:
DDX_Control(pDX, IDOK, m_OK);8、打开Dialog对话框IDD_XPDLG_DIALOG 并加入一个Button,双击这个Button,生成该按钮单击处理函数,在其中加入
CAboutDlg Dlg; Dlg.DoModal();9、运行Ctrl+F7