Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionTVN_SELCHANGING and TVN_SELCHANGED in CTreeCtrl - how to process and when? Pin
Vaclav_21-Sep-09 8:24
Vaclav_21-Sep-09 8:24 
AnswerRe: TVN_SELCHANGING and TVN_SELCHANGED in CTreeCtrl - how to process and when? Pin
Nemanja Trifunovic21-Sep-09 9:33
Nemanja Trifunovic21-Sep-09 9:33 
GeneralRe: TVN_SELCHANGING and TVN_SELCHANGED in CTreeCtrl - how to process and when? Pin
Vaclav_21-Sep-09 9:45
Vaclav_21-Sep-09 9:45 
GeneralRe: TVN_SELCHANGING and TVN_SELCHANGED in CTreeCtrl - how to process and when? Pin
Nemanja Trifunovic21-Sep-09 11:16
Nemanja Trifunovic21-Sep-09 11:16 
AnswerRe: TVN_SELCHANGING and TVN_SELCHANGED in CTreeCtrl - how to process and when? Pin
Michael Dunn22-Sep-09 13:06
sitebuilderMichael Dunn22-Sep-09 13:06 
QuestionIs there an easy way to have read only edit boxes or controls which are not all "greyed" out. Pin
Neil Urquhart21-Sep-09 8:06
Neil Urquhart21-Sep-09 8:06 
AnswerRe: Is there an easy way to have read only edit boxes or controls which are not all "greyed" out. Pin
Nuri Ismail21-Sep-09 8:24
Nuri Ismail21-Sep-09 8:24 
AnswerRe: Is there an easy way to have read only edit boxes or controls which are not all "greyed" out. Pin
Rajesh R Subramanian21-Sep-09 8:25
professionalRajesh R Subramanian21-Sep-09 8:25 
Neil Urquhart wrote:
Most MFC controls have a "Read Only" property so you can stop the user from making any changes to the value. However when you do this the control is displayed all in grey colours which makes it harder to read. Is there any easy way to make these controls "read only" but keep them obvious on screen, ie say in the default black and white? I am sure it can be done by overrding CEdit or similar and writing your own display code but this seems a bit to much like hard work.


Hi,

Nice question. Essentially, deriving your own class from CEdit would be the ideal way, but you say you don't want it. So, I have a silly hack for you.

Add a handler for EN_SETFOCUS and voluntarily give away the focus there. This way, the user won't be able to type anything into it or modify it. Because he just cannot set the focus. But, with a member variable for the control, you will be able to manipulate it from within your program, essentially making it "read only". Smile | :)

void CTestDlg::OnEnSetfocusEdit1()
{
	::SetFocus(m_hWnd);
}

void CTestDlg::OnBnClickedSetText()
{
	m_Edit.SetWindowText(_T("Sample text"));
}



It is a crappy thing, but it's life -^ Carlo Pallini

GeneralRe: Is there an easy way to have read only edit boxes or controls which are not all "greyed" out. Pin
Neil Urquhart21-Sep-09 19:33
Neil Urquhart21-Sep-09 19:33 
AnswerRe: Is there an easy way to have read only edit boxes or controls which are not all "greyed" out. Pin
Code-o-mat21-Sep-09 8:27
Code-o-mat21-Sep-09 8:27 
QuestionVC++ Pin
thangvel21-Sep-09 5:16
thangvel21-Sep-09 5:16 
AnswerRe: VC++ Pin
Rajesh R Subramanian21-Sep-09 6:18
professionalRajesh R Subramanian21-Sep-09 6:18 
QuestionRe: VC++ Pin
David Crow21-Sep-09 9:02
David Crow21-Sep-09 9:02 
Questionsome libraries are not getting linked in debug mode(vs-2008) but working in release mode [modified] Pin
Vetukuri Raju21-Sep-09 4:55
Vetukuri Raju21-Sep-09 4:55 
AnswerRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Richard MacCutchan21-Sep-09 7:31
mveRichard MacCutchan21-Sep-09 7:31 
AnswerRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Rajesh R Subramanian21-Sep-09 9:00
professionalRajesh R Subramanian21-Sep-09 9:00 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Richard MacCutchan21-Sep-09 11:40
mveRichard MacCutchan21-Sep-09 11:40 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Rajesh R Subramanian21-Sep-09 17:51
professionalRajesh R Subramanian21-Sep-09 17:51 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Richard MacCutchan22-Sep-09 1:52
mveRichard MacCutchan22-Sep-09 1:52 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Saurabh.Garg21-Sep-09 15:40
Saurabh.Garg21-Sep-09 15:40 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Rajesh R Subramanian21-Sep-09 17:53
professionalRajesh R Subramanian21-Sep-09 17:53 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Saurabh.Garg21-Sep-09 18:57
Saurabh.Garg21-Sep-09 18:57 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Rajesh R Subramanian21-Sep-09 19:49
professionalRajesh R Subramanian21-Sep-09 19:49 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Saurabh.Garg21-Sep-09 19:58
Saurabh.Garg21-Sep-09 19:58 
GeneralRe: some libraries are not getting linked in debug mode(vs-2008) but working in release mode Pin
Rajesh R Subramanian22-Sep-09 0:06
professionalRajesh R Subramanian22-Sep-09 0:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.