还有,我想请教一下各位高手,我如何改变对话框的颜色,控件的颜色,窗口的颜色,包括框架等的颜色?
解决方案 »
- template语法问题,解决后立刻揭帖。请稍微用1分钟,帮助一个新手。您获得的不止是感激。
- 数据库查询代码的问题?
- 有没有哪位大哥可以提供一个文本编辑器的源码?
- 五一不能到处玩玩,郁闷ing
- VC 中怎么在top屏幕画线
- 如何在程序中改变弹出对话框的标题呀?对于ccombox组合框控键如何设置成其下拉箭头不起作用呀?
- 请问一个多文件源码怎样编译???
- WSAGetOverlappedResult函数有什么用啊?????
- 日期为变量,sqlite按日期查询
- 关于MFC多文档切换视图的问题
- 在ATL的COM中如何判断一个文件存在(FileExist)?
- 如何登录win2000,用什么api函数?
afx_msg HBRUSH OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor );Return ValueOnCtlColor must return a handle to the brush that is to be used for painting the control background.ParameterspDCContains a pointer to the display context for the child window. May be temporary.pWndContains a pointer to the control asking for the color. May be temporary.nCtlColorContains one of the following values, specifying the type of control: CTLCOLOR_BTN Button control
CTLCOLOR_DLG Dialog box
CTLCOLOR_EDIT Edit control
CTLCOLOR_LISTBOX List-box control
CTLCOLOR_MSGBOX Message box
CTLCOLOR_SCROLLBAR Scroll-bar control
CTLCOLOR_STATIC Static control
ResThe framework calls this member function when a child control is about to be drawn. Most controls send this message to their parent (usually a dialog box) to prepare the pDC for drawing the control using the correct colors.To change the text color, call the SetTextColor member function with the desired red, green, and blue (RGB) values. To change the background color of a single-line edit control, set the brush handle in both the CTLCOLOR_EDIT and CTLCOLOR_MSGBOX message codes, and call the CDC::SetBkColor function in response to the CTLCOLOR_EDIT code.OnCtlColor will not be called for the list box of a drop-down combo box because the drop-down list box is actually a child of the combo box and not a child of the window. To change the color of the drop-down list box, create a CComboBox with an override of OnCtlColor that checks for CTLCOLOR_LISTBOX in the nCtlColor parameter. In this handler, the SetBkColor member function must be used to set the background color for the text.Note This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.