Click here to Skip to main content
16,011,680 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to program a ftp-server Pin
l a u r e n1-Mar-01 9:45
l a u r e n1-Mar-01 9:45 
AnswerRe: How to program a ftp-server Pin
Erik Funkenbusch1-Mar-01 13:03
Erik Funkenbusch1-Mar-01 13:03 
GeneralRe: How to program a ftp-server Pin
Cabadam7-May-01 15:01
Cabadam7-May-01 15:01 
QuestionHow to change font of Property Sheet? Pin
Nikolay Denisov1-Mar-01 3:22
Nikolay Denisov1-Mar-01 3:22 
AnswerRe: How to change font of Property Sheet? Pin
James R. Twine1-Mar-01 5:33
James R. Twine1-Mar-01 5:33 
GeneralRe: How to change font of Property Sheet? Pin
Nikolay Denisov1-Mar-01 19:38
Nikolay Denisov1-Mar-01 19:38 
GeneralRe: Property Sheets in Dialog Bar Pin
Rob Planche1-Mar-01 2:52
Rob Planche1-Mar-01 2:52 
GeneralBlue ComboBox, Problem with DrawItem Pin
Natacha1-Mar-01 1:40
Natacha1-Mar-01 1:40 
I need a Blue Combobox with white text:
I have a new class CBlueComboBox derived from CComboBox. My combo is declared in my Ressource
as OwnerDraw, Fixed and has String.
In the new class I overwrite the DrawItem function:

void CBlueComboBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
ASSERT(lpDrawItemStruct->CtlType == ODT_COMBOBOX);

CDC dc;

CString strText;
GetLBText (lpDrawItemStruct->itemID,strText);


dc.Attach(lpDrawItemStruct->hDC);

COLORREF crOldTextColor = dc.GetTextColor();
COLORREF crOldBkColor = dc.GetBkColor();

if ((lpDrawItemStruct->itemAction | ODA_SELECT) &&
(lpDrawItemStruct->itemState & ODS_SELECTED))
{
dc.SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));
dc.SetBkColor(::GetSysColor(COLOR_HIGHLIGHT));
dc.FillSolidRect(&lpDrawItemStruct->rcItem, ::GetSysColor(COLOR_HIGHLIGHT));
}
else
{
dc.SetTextColor(RGB(255,255,255));
dc.SetBkColor(RGB(41,66,148));
dc.FillSolidRect(&lpDrawItemStruct->rcItem,RGB(41,66,148));
}

dc.DrawText(strText, &lpDrawItemStruct->rcItem, DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP | DT_VCENTER);

dc.SetTextColor(crOldTextColor);
dc.SetBkColor(crOldBkColor);

dc.Detach();
}

All is OK apart the text: Combo si blue, text is white
but the text is not written correctly, it is alway the same control caracter.

Could someone help me?






Confused | :confused:

Thanks
Natacha
GeneralRe: Blue ComboBox, Problem with DrawItem Pin
l a u r e n1-Mar-01 3:37
l a u r e n1-Mar-01 3:37 
GeneralRe: Blue ComboBox, Problem with DrawItem Pin
16-May-01 3:03
suss16-May-01 3:03 
GeneralHOWTO: Determine windows login Pin
neilbennevis1-Mar-01 1:23
neilbennevis1-Mar-01 1:23 
GeneralWriting a C++ DLL with VB-compatibility in mind Pin
#realJSOP1-Mar-01 1:14
professional#realJSOP1-Mar-01 1:14 
GeneralRe: Writing a C++ DLL with VB-compatibility in mind Pin
l a u r e n1-Mar-01 3:28
l a u r e n1-Mar-01 3:28 
GeneralRe: Writing a C++ DLL with VB-compatibility in mind Pin
#realJSOP1-Mar-01 3:33
professional#realJSOP1-Mar-01 3:33 
GeneralRe: Writing a C++ DLL with VB-compatibility in mind Pin
l a u r e n1-Mar-01 3:41
l a u r e n1-Mar-01 3:41 
GeneralRe: Writing a C++ DLL with VB-compatibility in mind Pin
Chris Losinger1-Mar-01 3:57
professionalChris Losinger1-Mar-01 3:57 
GeneralRun a program Pin
1-Mar-01 1:11
suss1-Mar-01 1:11 
GeneralRe: Run a program Pin
1-Mar-01 1:15
suss1-Mar-01 1:15 
GeneralCMapStringToString Pin
28-Feb-01 23:51
suss28-Feb-01 23:51 
GeneralRe: CMapStringToString Pin
Steve Driessens2-Mar-01 3:05
Steve Driessens2-Mar-01 3:05 
GeneralNeed help with Dialogs... Pin
28-Feb-01 23:35
suss28-Feb-01 23:35 
GeneralRe: Need help with Dialogs... Pin
l a u r e n28-Feb-01 23:38
l a u r e n28-Feb-01 23:38 
GeneralThreading in vc Pin
28-Feb-01 22:32
suss28-Feb-01 22:32 
GeneralRe: Threading in vc Pin
l a u r e n28-Feb-01 23:34
l a u r e n28-Feb-01 23:34 
GeneralRe: Threading in vc Pin
Erik Funkenbusch1-Mar-01 13:09
Erik Funkenbusch1-Mar-01 13:09 

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.