Click here to Skip to main content
15,894,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionQuestion on Dialog & ComboBox Pin
Software200725-Feb-10 8:08
Software200725-Feb-10 8:08 
AnswerRe: Question on Dialog & ComboBox Pin
Maximilien25-Feb-10 8:13
Maximilien25-Feb-10 8:13 
GeneralRe: Question on Dialog & ComboBox Pin
Software200725-Feb-10 8:18
Software200725-Feb-10 8:18 
QuestionRe: Question on Dialog & ComboBox Pin
David Crow25-Feb-10 17:10
David Crow25-Feb-10 17:10 
AnswerRe: Question on Dialog & ComboBox Pin
KingsGambit25-Feb-10 19:21
KingsGambit25-Feb-10 19:21 
AnswerRe: Question on Dialog & ComboBox Pin
David Crow26-Feb-10 4:18
David Crow26-Feb-10 4:18 
QuestionUsing Flashvars in MFC C++ Pin
lesliecasas25-Feb-10 7:36
lesliecasas25-Feb-10 7:36 
QuestionProblem with owner-drawn list box Pin
sashoalm25-Feb-10 6:30
sashoalm25-Feb-10 6:30 
I have a class derived from CListBox which is owner-drawn (I implement the DrawItem function). My problem is I use a white brush for the background, but when the list box is empty, its background is just gray. As soon as one item has been added, the background becomes white.




My drawing function is very simple:
void CNiceListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
	CString txt = (const TCHAR*)lpDrawItemStruct->itemData;
	CDC dc;
	dc.Attach(lpDrawItemStruct->hDC);
	CRect r(lpDrawItemStruct->rcItem);
	dc.SetBkMode(TRANSPARENT);
	dc.SelectObject(m_font);
	dc.FillRect(&r, (lpDrawItemStruct->itemState & ODS_SELECTED ) ? &m_selectedBrush : &m_listBoxBackBrush);
	dc.DrawText(txt, txt.GetLength(), r, DT_VCENTER | DT_SINGLELINE | DT_LEFT);

	dc.Detach();
}


Where's the problem?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal

AnswerRe: Problem with owner-drawn list box Pin
Maximilien25-Feb-10 7:41
Maximilien25-Feb-10 7:41 
AnswerRe: Problem with owner-drawn list box Pin
Eugen Podsypalnikov25-Feb-10 20:09
Eugen Podsypalnikov25-Feb-10 20:09 
Questionaccounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
23_44425-Feb-10 6:08
23_44425-Feb-10 6:08 
AnswerRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
Gwenio25-Feb-10 16:26
Gwenio25-Feb-10 16:26 
GeneralRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
23_44426-Feb-10 3:20
23_44426-Feb-10 3:20 
GeneralRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
Gwenio26-Feb-10 3:59
Gwenio26-Feb-10 3:59 
GeneralRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
23_44426-Feb-10 4:36
23_44426-Feb-10 4:36 
GeneralRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
23_44426-Feb-10 7:48
23_44426-Feb-10 7:48 
QuestionWho can recommend some UI tools? Pin
Aric Wang25-Feb-10 5:48
Aric Wang25-Feb-10 5:48 
QuestionRe: Who can recommend some UI tools? Pin
Maximilien25-Feb-10 6:21
Maximilien25-Feb-10 6:21 
QuestionHandling A Scrollbar Vertical Scroll command Pin
maycockt24-Feb-10 23:25
maycockt24-Feb-10 23:25 
AnswerRe: Handling A Scrollbar Vertical Scroll command Pin
Nelek25-Feb-10 0:08
protectorNelek25-Feb-10 0:08 
GeneralRe: Handling A Scrollbar Vertical Scroll command Pin
maycockt25-Feb-10 0:42
maycockt25-Feb-10 0:42 
GeneralRe: Handling A Scrollbar Vertical Scroll command Pin
Nelek25-Feb-10 0:52
protectorNelek25-Feb-10 0:52 
GeneralRe: Handling A Scrollbar Vertical Scroll command Pin
maycockt25-Feb-10 1:11
maycockt25-Feb-10 1:11 
AnswerRe: Handling A Scrollbar Vertical Scroll command Pin
Nelek25-Feb-10 20:58
protectorNelek25-Feb-10 20:58 
GeneralRe: Handling A Scrollbar Vertical Scroll command [modified] Pin
maycockt25-Feb-10 22:59
maycockt25-Feb-10 22:59 

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.