Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: KeyBoard hook Doubt Pin
_anil_20-Sep-06 0:02
_anil_20-Sep-06 0:02 
GeneralRe: KeyBoard hook Doubt Pin
Naveen20-Sep-06 2:11
Naveen20-Sep-06 2:11 
Questionedit control how to get deleted text Pin
harsha_123419-Sep-06 22:37
harsha_123419-Sep-06 22:37 
AnswerRe: edit control how to get deleted text Pin
Rinu_Raj19-Sep-06 22:46
Rinu_Raj19-Sep-06 22:46 
GeneralRe: edit control how to get deleted text Pin
harsha_123419-Sep-06 22:55
harsha_123419-Sep-06 22:55 
GeneralRe: edit control how to get deleted text Pin
Rinu_Raj19-Sep-06 23:08
Rinu_Raj19-Sep-06 23:08 
AnswerRe: edit control how to get deleted text Pin
toxcct19-Sep-06 22:48
toxcct19-Sep-06 22:48 
QuestionHow to display CStatic Pin
gomez_a19-Sep-06 22:33
gomez_a19-Sep-06 22:33 
I have an MFC application (VS 2003 Std). There is a dialog window with CStaticText. For example:
CStatic lblRecno;

I want to change the colour of the CStaticText.
I am using the OnCtlColor function:

HBRUSH DlgBackup::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = NULL;
/*
if(pWnd->GetDlgCtrlID() == IDC_STATIC_LP)
or
*/
if( nCtlColor == CTLCOLOR_STATIC )
{
pDC->SetTextColor(clBlack);
pDC->SetBkMode(TRANSPARENT);
hbr = (HBRUSH) GetStockObject( NULL_BRUSH );
}
else
{
hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}

return hbr;
}
To this place is OK.

Now I am changeing the lblRecno value in the while loop:
int lp = 0;
CString newTxt = "";
while(...)
{
++lp;
bewTxt.Format("%d", lp);
lblRecno.SetWindowText(newTxt);
}
But the new value lblRecno is displaying in the place of the previous value, an so on.
I think I should to use the WM_ERASEBKGND, but I don't know how to do it.

Can you help me.

Regards
mwgomez
Poland

AnswerRe: How to display CStatic Pin
Rinu_Raj19-Sep-06 22:39
Rinu_Raj19-Sep-06 22:39 
GeneralRe: How to display CStatic Pin
gomez_a19-Sep-06 23:58
gomez_a19-Sep-06 23:58 
AnswerRe: How to display CStatic Pin
Rinu_Raj20-Sep-06 0:03
Rinu_Raj20-Sep-06 0:03 
GeneralRe: How to display CStatic Pin
gomez_a20-Sep-06 1:19
gomez_a20-Sep-06 1:19 
GeneralRe: How to display CStatic Pin
Rinu_Raj20-Sep-06 1:49
Rinu_Raj20-Sep-06 1:49 
GeneralRe: How to display CStatic Pin
gomez_a20-Sep-06 2:34
gomez_a20-Sep-06 2:34 
GeneralRe: How to display CStatic Pin
David Crow20-Sep-06 2:53
David Crow20-Sep-06 2:53 
QuestionRe: How to display CStatic Pin
David Crow20-Sep-06 2:56
David Crow20-Sep-06 2:56 
QuestionSQL Server [modified] Pin
Bravoone_200619-Sep-06 22:31
Bravoone_200619-Sep-06 22:31 
QuestionRe: SQL Server Pin
David Crow20-Sep-06 3:43
David Crow20-Sep-06 3:43 
Questionproblem with pointer Pin
zizzzz19-Sep-06 22:15
zizzzz19-Sep-06 22:15 
QuestionRe: problem with pointer Pin
prasad_som19-Sep-06 22:34
prasad_som19-Sep-06 22:34 
AnswerRe: problem with pointer Pin
zizzzz19-Sep-06 22:43
zizzzz19-Sep-06 22:43 
GeneralRe: problem with pointer Pin
Cedric Moonen19-Sep-06 22:54
Cedric Moonen19-Sep-06 22:54 
QuestionMFC and MySQL problem Pin
DDeliyiannis19-Sep-06 22:15
DDeliyiannis19-Sep-06 22:15 
QuestionVC++ Setting Background as BMP Pin
arti mujumdar19-Sep-06 21:27
arti mujumdar19-Sep-06 21:27 
AnswerRe: VC++ Setting Background as BMP Pin
Naveen19-Sep-06 21:43
Naveen19-Sep-06 21:43 

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.