我在对话框中有button1、button2
按button1时显示“123”
按button2时显示“456”
button1单击事件代码如下:
CDC *pDC=GetDC();
CFont font;
pDC->SelectObject(&font);
CString str;
pDC->SetTextColor(RGB(39,244,10));
pDC->SetBkMode(TRANSPARENT);//设置背景模式为透明
str.Format("123");
pDC->TextOut(10,10,str);
button2如上述那么写会有重叠效果,所以我就不知道了(背景色必须设为透明)还请高人指点
按button1时显示“123”
按button2时显示“456”
button1单击事件代码如下:
CDC *pDC=GetDC();
CFont font;
pDC->SelectObject(&font);
CString str;
pDC->SetTextColor(RGB(39,244,10));
pDC->SetBkMode(TRANSPARENT);//设置背景模式为透明
str.Format("123");
pDC->TextOut(10,10,str);
button2如上述那么写会有重叠效果,所以我就不知道了(背景色必须设为透明)还请高人指点
解决方案 »
- 怎么用代码实现 windows xp 按Ctrl键快速关机?
- 函数指针在使用时的错误,求解
- tcscpy
- skin++又有问题了
- 我的字体设置为什么错误
- About Intel C++ Compile
- 请问怎么做Winamp那样的磁性窗口啊?(不够另开贴加分)
- 怎样在SDI程序一开始执行就显示我的Dialog(online)
- ISAPI调试:Build/Start Debug/attach to Process/Show System Process怎么什么都没有?
- 我想从类CMDIFrameWnd派生出一个新类,为啥在ClassWizard的下拉框中找不到?
- uchar* 如何转成图像,或者直接显示在mfc控件上
- 高手请进,麻烦看一下我的数据格式转换有没有问题
一个相应中:
str = "123";
Invalidate();
另一个响应中
str = "456";
Invalidate();在WM_PAINT响应中:
CFont font;
pDC->SelectObject(&font);
CString str;
pDC->SetTextColor(RGB(39,244,10));
pDC->SetBkMode(TRANSPARENT);//设置背景模式为透明
pDC->TextOut(10,10,str);