Home > Software engineering >  MFC list CTRL for a row gray questions
MFC list CTRL for a row gray questions

Time:10-04

MFC LIST CTRL how to do make a row to the effect of ash, as shown in the following three lines of the effect of this kind of gray, and it is the grey has a gradient effect, is slowly into the gray, MFC master to give some ideas for

CodePudding user response:

I am a for loop in c #, sleep (200); The background color in the RGB tricolor (0.0.0) into (255.255 255)

CodePudding user response:

Change the color in the NM_CUSTOMDRAW

CodePudding user response:

OnTimer redraw:
 
Void CYourListCtrl: : OnTimer (UINT nIDEvent)
{
//TODO: Add your message handler code here and/or call the default
The static BYTE gray=0;
If (gray & gt;
=200){
KillTimer (1);
return;
}
The else
{
Gray +=10;
}
The CDC * PDC=GetDC ();
PDC - & gt; SetTextColor (RGB (gray, gray, gray));
Int col=GetHeaderCtrl () - & gt; GetItemCount ();
CRect rc;
For (int jj=0; Jj{
GetSubItemRect (4, jj, LVIR_LABEL, rc);
PDC - & gt; TextOut (rc) left, rc. Top GetItemText (4, jj));
}
The ReleaseDC (PDC);
//CListCtrl: : OnTimer (nIDEvent);
}

CodePudding user response:

Since the draw control
SetGray (const int lineIndex) {
Start a Timer, a grow grey lines
}

CodePudding user response:

You such a demand, only the custom painting.

CodePudding user response:

Custom painting is sooner or later learn skills;
Since the hi is to master the ability of sooner or later,

CodePudding user response:

Since the draw CListCtrl, reference example I do
http://blog.csdn.net/hurryboylqs/article/details/5862046
  • Related