Click here to Skip to main content
14,265,815 members

C / C++ / MFC

 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 21:12
memberStefan_Lang28-Jan-19 21:12 
AnswerRe: How to print all source code what was running? Pin
Victor Nijegorodov26-Jan-19 5:26
memberVictor Nijegorodov26-Jan-19 5:26 
GeneralRe: How to print all source code what was running? Pin
Member 1308136926-Jan-19 12:05
memberMember 1308136926-Jan-19 12:05 
GeneralRe: How to print all source code what was running? Pin
Victor Nijegorodov27-Jan-19 0:02
memberVictor Nijegorodov27-Jan-19 0:02 
GeneralRe: How to print all source code what was running? Pin
Member 1308136928-Jan-19 1:38
memberMember 1308136928-Jan-19 1:38 
GeneralRe: How to print all source code what was running? Pin
Victor Nijegorodov28-Jan-19 1:51
memberVictor Nijegorodov28-Jan-19 1:51 
AnswerRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 1:46
memberStefan_Lang28-Jan-19 1:46 
QuestionHow to change the background color of checkbox in CListCtrl? Pin
manoharbalu23-Jan-19 19:05
membermanoharbalu23-Jan-19 19:05 
How to change the background color of checkbox in CListCtrl?

The checkbox appears before the 1st column. if I change the background using m_cLstCtrl.SetBkColor(RGB(0,0,0)); the background of the entire control is changed.

If I change it inside OnCustomDraw as below:
void CSysWindow::OnCustomDrawAlarmLine ( NMHDR* pNMHDR, LRESULT* pResult )
{
NMLVCUSTOMDRAW *pCD = (NMLVCUSTOMDRAW*)pNMHDR;
// By default set the return value to do the default behavior.
*pResult = CDRF_DODEFAULT ;

//obtain row and column of item
int iRow = pCD->nmcd.dwItemSpec;
int iCol = pCD->iSubItem;

//Remove standard highlighting of selected (sub)item.
pCD->nmcd.uItemState = CDIS_DEFAULT;

switch( pCD->nmcd.dwDrawStage )
{
case CDDS_PREPAINT: // First stage (for the whole control)
{

*pResult = CDRF_NOTIFYITEMDRAW;

}
break;

case CDDS_ITEMPREPAINT:
{

*pResult = CDRF_NOTIFYSUBITEMDRAW;

}
break;

case CDDS_ITEMPREPAINT | CDDS_SUBITEM : // Stage three
{
if ((iCol != 0) || (iCol != 1))
{
pCD->clrText = RGB(255,0,0);
pCD->clrTextBk = RGB(0,0,0);
}
if ((iCol == 0) || (iCol == 1))
{
pCD->clrText = RGB(255,0,0);
pCD->clrTextBk = RGB(0,255,0);
}
//if (sub)item is of interest, set custom text/background color
//if( 1 == iRow && 3 == iCol )
//{
// pCD->clrText = RGB(255,0,0);
// pCD->clrTextBk = RGB(210,245,245);
//}
//else
//{
// pCD->clrText = RGB(0,0,0);
// pCD->clrTextBk = RGB(255,255,255);
//}

*pResult = CDRF_NOTIFYPOSTPAINT;

}
break;

case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM: // Stage four (called for each subitem of the focused item)
{

}
break;

default:// it wasn't a notification that was interesting to us.
{
*pResult = CDRF_DODEFAULT;
}
break;
}
}

The background of the other column gets changed. but not the Checkbox.

So...How to change the background of the checkbox column alone?
SuggestionRe: How to change the background color of checkbox in CListCtrl? Pin
Richard MacCutchan23-Jan-19 22:37
protectorRichard MacCutchan23-Jan-19 22:37 
GeneralRe: How to change the background color of checkbox in CListCtrl? Pin
manoharbalu24-Jan-19 1:35
membermanoharbalu24-Jan-19 1:35 
QuestionTools to refactor C++ code - Rad studio Pin
ptr_Electron23-Jan-19 17:48
memberptr_Electron23-Jan-19 17:48 
AnswerRe: Tools to refactor C++ code - Rad studio Pin
Richard MacCutchan23-Jan-19 22:33
protectorRichard MacCutchan23-Jan-19 22:33 
AnswerRe: Tools to refactor C++ code - Rad studio Pin
Maximilien24-Jan-19 8:36
memberMaximilien24-Jan-19 8:36 
AnswerRe: Tools to refactor C++ code - Rad studio Pin
Stefan_Lang25-Jan-19 3:54
memberStefan_Lang25-Jan-19 3:54 
QuestionWhat are the security risks by embedding the Python in C++ application, if any. Pin
oleg6322-Jan-19 9:11
professionaloleg6322-Jan-19 9:11 
AnswerRe: What are the security risks by embedding the Python in C++ application, if any. Pin
Joe Woodbury22-Jan-19 10:40
professionalJoe Woodbury22-Jan-19 10:40 
QuestionWhat extensions for Visual Studio can you recommend? Pin
Froddo22-Jan-19 5:53
memberFroddo22-Jan-19 5:53 
AnswerRe: What extensions for Visual Studio can you recommend? Pin
Victor Nijegorodov22-Jan-19 10:13
memberVictor Nijegorodov22-Jan-19 10:13 
GeneralRe: What extensions for Visual Studio can you recommend? Pin
Froddo23-Jan-19 3:40
memberFroddo23-Jan-19 3:40 
GeneralRe: What extensions for Visual Studio can you recommend? Pin
Member 1412742230-Jan-19 4:27
memberMember 1412742230-Jan-19 4:27 
GeneralRe: What extensions for Visual Studio can you recommend? Pin
Froddo31-Jan-19 1:25
memberFroddo31-Jan-19 1:25 
GeneralRe: What extensions for Visual Studio can you recommend? Pin
Member 141274221-Feb-19 6:27
memberMember 141274221-Feb-19 6:27 
GeneralRe: What extensions for Visual Studio can you recommend? Pin
Froddo12-Feb-19 6:48
memberFroddo12-Feb-19 6:48 
QuestionSetCheck() for checkbox in MFC GridControl 2.7 Pin
Anu_Bala21-Jan-19 18:16
memberAnu_Bala21-Jan-19 18:16 
AnswerRe: SetCheck() for checkbox in MFC GridControl 2.7 Pin
Richard MacCutchan21-Jan-19 22:43
protectorRichard MacCutchan21-Jan-19 22: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.