|
-
February 6th, 2003, 05:21 AM
#1
how can I change the fontstyle of an Item in ComboBox or DropDown Control?
Hi,
I want to change the fontstyle of an specific item in dropdown Control using WinAPI is that possible ?
if yes are ther any decumentation availible ?
thanks
XSnack
-
February 6th, 2003, 06:25 PM
#2
try mabye:
Code:
LOGFONT LogFont;
HFONT hFont= CreateFontIndirect(&LogFont);
CHOOSEFONT cf = {sizeof(CHOOSEFONT)};
COLORREF g_rgbText = RGB(0, 0, 0);
cf.Flags = CF_EFFECTS | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS;
cf.hwndOwner = hWnd;
cf.lpLogFont = &LogFont;
cf.rgbColors = g_rgbText;
LogFont.lfHeight=14;
LogFont.lfWidth=8;
LogFont.lfEscapement=0; // Making Font
LogFont.lfOrientation=0;
LogFont.lfWeight=300;
LogFont.lfItalic=0;
LogFont.lfUnderline=0;
LogFont.lfStrikeOut=0;
LogFont.lfCharSet=1;
LogFont.lfOutPrecision=OUT_TT_PRECIS;
LogFont.lfClipPrecision=CLIP_DEFAULT_PRECIS;
LogFont.lfQuality=DRAFT_QUALITY;
LogFont.lfPitchAndFamily=FF_MODERN;
if(ChooseFont(&cf))
{
HFONT hf = CreateFontIndirect(&LogFont);
if(hf)
{
hFont = hf;
SendDlgItemMessage(hWnd, YOUR_ID, WM_SETFONT, (WPARAM)hFont, TRUE);
}
}
as for specific item,
there could be an SETITEMTEXT message, check it out
Bengi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|