已定义一个CEdit变量m_edit
根据这个变量m_edit,如何设置它的背景色?
根据这个变量m_edit,如何设置它的背景色?
解决方案 »
- VC 多媒体定时器的回调函数是否可能出现重入的情况
- 关于outlook联系人!
- 如何将一个包含HTML的CString解释后显示在一个给定的CDC中?
- 菜鸟 求教关于char与CSring
- 100分求一个不到50行代码的程序(读XML的)
- ***在线等待,菜鸟送分问题,如何隐式连接DLL到自己的工程中去???
- 如何释放CStringArray里面的对象?
- 我的程序怎么在启动另一个程序后,给他的一个按钮发送一个单击消息~~~
- 也是关于通讯,有谁编过对RS-485串行通讯接口的程序请指点,还可再加分
- 一个不是很难的问题,为什么我都给300分了还没有人回答?????????????????????????
- 我想获得windows资源管理器那样的界面
- 是中国人的请去看看,我别的都不为,只为对得起自己的那颗中国心!
The EDITBOX element provides a way for users to enter text within a skin.The EDITBOX element supports the following attributes.Attribute Description
backgroundColor Specifies or retrieves the background color for the edit box control.
border Specifies or retrieves a value indicating whether the edit box control has a border.
editStyle Specifies or retrieves the style of the edit box control.
fontFace Specifies or retrieves the font used for text in the edit box control.
fontSize Specifies or retrieves the font size for the edit box control.
fontStyle Specifies or retrieves the font style for the edit box control.
foregroundColor Specifies or retrieves the text color in the edit box control.
justification Specifies or retrieves the alignment of the text within the edit box control.
lineCount Retrieves the number of lines in the edit box control.
readOnly Specifies or retrieves a value indicating whether text in the edit box control is read-only or can be edited.
textLimit Specifies or retrieves the maximum number of characters that the user can type in the edit box control.
value Specifies or retrieves the text that is displayed in the edit box control.
wordWrap Specifies or retrieves a value indicating whether word wrap is enabled in the edit box control.
The EDITBOX element supports the following methods.Method Description
getLine Retrieves the text for the line with the specified index.
getLineFromChar Retrieves the line index for the specified character index.
getLineIndex Retrieves the character index for the specified line index.
getSelectionEnd Retrieves the ending position of the selected text in the edit box control.
getSelectionStart Retrieves the starting position of the selected text in the edit box control.
replaceSelection Replaces the current selection with the specified text.
setSelection Selects the text in the edit box control from the specified start index to the specified end index.
The EDITBOX element supports the ambient attributes and can implement all ambient event handlers with the exception of onclick. For more information, see Ambient Attributes and Ambient Event Handlers.这是MSDN 上关于EDITBOX 的原话,楼主仔细看看就明白了,我多说了也是废话
Dialog构造函数中m_b.CreateSolidBrush(RGB(0,255,0));
重载WM_CTLCOLOR消息,在OnCtlColor函数中加上
if(nCtlColor==CTLCOLOR_EDIT)return m_b;
如果我只想部分的编辑框改变呢?
好象不能把编辑框全部画满背景色啊
只有显示文字的那一行有颜色
if(pWnd->GetDlgCtrlID()==IDC_EDIT1)return m_b;
akiko,你的方法是可行的,但是OnCtlColor这个函数应该怎么调用?
怎样PostMessage才能使得处理的是相应的编辑框?
谢谢
然后重载CtlColor函数
在里面修改