read only edit control
Hi,
I have an edit control and it is read only edit control.
I changed its text color so whatever i want to display in this edit control i display the text in according to my colcor selection. but the thing i want to do is i want to disable the text box so that cursor will not display in the read only edit control when user clicks on the edit control and user cant be able to select the text from that read only edit control. but when i set the disalble property of edit control to true then it will disable my read only edit control and cursor will not display in edit control and user cant select from that edit control but the color i set in edit control is not displayed.
means after setting the property disable to TRUE my edit control display the text simple in BLACk color... i want to disable the edit control as well as i want to dispaly the text according to my choice.
how can i fix my problem plz anyone suggest me
Thanks in advance..
# 1 Re: read only edit control
If you don't want the user to select anything, why don't you use a static control instead of an edit control?
Marc G at 2007-11-9 13:30:50 >

# 2 Re: read only edit control
sorry but i want to do it for Edit control. i cant use static control as i dont want to change whole code to replace an edit control with static control..
tell me is there any way to stop selection in edit control.. as if i disable it the edit control will not display the text colored..
# 3 Re: read only edit control
Actually, Mar_G's point is very good to achieve this.
In addition, if you insist on keep edit control , a not good way to achieve this: Disable cursor when you find the focus is in edit control , or by using timer to set focus on another control.
# 5 Re: read only edit control
Try to set 'read only' style on or derive your own class from CEdit, overwrite WM_LBUTTONDOWN message handlers and do not call base-class ones.
Then subclass your CEdit-derived class.
or ShowCursor(FALSE) to hide the cursor when you need.
# 6 Re: read only edit control
ShowCursor(FALSE); is not a member of CEdit class how can i use this ShowCursor() function as i am writing the code on
void CReadOnlyDlg::OnEnSetfocusEdit1()
{
m_Edit123......... what to do with this..
}
# 7 Re: read only edit control
You may use it when you want to hide your cursor , but you have to set it into TRUE when you want it display .