UpdateData()的使用方法
UpdateData()只有一个BOOL类型的参数,UpdateData(FALSE)一般用于对话框控件连接的变量值刷新屏幕显示;比如你在一个文本框上绑定了一个m_member变量,用UpdateData(FALSE);即可把这个值在文本框里显示出来,反之,UpdateData(TRUE);能把填入文本框的 内容赋值给m_member.
透明的CheckBox,基类是CButton...
主要代码如下
OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect rect;
GetClientRect(&rect);
CRect BoxRect;
BoxRect=rect;
BoxRect.right =BoxRect.left +15;
dc.DrawFrameControl(BoxRect,DFC_BUTTON,DFCS_BUTTONCHECK|GetCheck()?DFCS_CHECKED :0);
CFont myFont;
myFont.CreatePointFont (120,_T("宋体"));
CFont *pOldFont=(CFont *)dc.SelectObject (&myFont);
dc.SetBkMode(TRANSPARENT);
CString StrWndText;
GetWindowText(StrWndText);
rect.OffsetRect (20,0);
dc.DrawText(StrWndText, rect, DT_LEFT|DT_VCENTER|DT_SINGLELINE);
dc.SelectObject (pOldFont);
myFont.DeleteObject ();
// Do not call CButton::OnPaint() for painting messages
}