记得好象是在OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)中改变画刷,但是搞不定,不知怎么回事,特求救,有什么需要注意的东西??
谢谢各位高手指教
谢谢各位高手指教
解决方案 »
- 我要写个坦克大战的游戏。对于敌人坦克的出现,坦克的移动,发子弹等的设计,大家有没有好的建议呢?
- mfc中如何判断是否读取了一个文件。
- 怎样得到Combo Box里面用户输入的值啊?
- 学习MFC之前C++需要掌握到什么程度?
- VC6.0 开发的软件在WindowXp Sp2上安装出现问题?
- 一个很基础的问题(高分)
- 怎样使导入的bmp文件的背景色是透明??
- 有谁可以提供一个vc的绘图程序??(高分相送)
- 能不能在数据库中查询出一定条件的记录,以后的操作都在这些记录中进行
- 一个程序怎么编才能又可做Client又可做Server
- 蔡鸟求救,main函数中argc是怎么赋值的?怎么会有判断条件argc<=1的?多谢!
- BUG, 有什么好办法解决 ADO 这个准臭虫
{
HBRUSH hbr = CreateSolidBrush(RGB(255,255,200));
return hbr;
}
不过用这个如果你的对话框上没有什么动态显示的东西还可以,如果有时间刷新之类
的东东,劝你还是用图片作背景好了,否则要花屏的!
{
switch (nCtlColor) { case CTLCOLOR_STATIC:
// Set the static text to white on blue.
pDC->SetTextColor(RGB(255, 255, 255));
pDC->SetBkColor(RGB(0, 0, 255));
// Drop through to return the background brush. case CTLCOLOR_DLG:
return (HBRUSH)(m_pBkBrush.GetSafeHandle()); default:
return CFileDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
}
我最近做了一个图片背景的俄罗斯方块~
什么双缓冲,内存DC
搞得我头发都快白了
void SetDialogBkColor( COLORREF clrCtlBk = RGB(192, 192, 192), COLORREF clrCtlText = RGB(0, 0, 0) );ParametersclrCtlBkThe dialog background color for the application.clrCtlTextThe dialog control color for the application.ResCall this member function from within the InitInstance member function to set the default background and text color for dialog boxes and message boxes within your application.ExampleBOOL CMyApp::InitInstance()
{
// Standard initialization SetDialogBkColor(); // Set dialog background color to gray
LoadStdProfileSettings(); // Load standard INI file options (including MRU) // ...
}