33.1 常用的字体复制
方法一
CFont* pFont = pDC->GetCurrentFont();
LOGFONT lf;
pFont->GetLogFont(&lf);
m_fontN.CreateFontIndirect(&lf);
lf.lfUnderline = TRUE;
m_fontT.CreateFontIndirect(&lf);
方法二
HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
LOGFONT lf;
GetObject(hFont, sizeof(lf), &lf);
m_fontN.CreateFontIndirect(&lf);
lf.lfUnderline = TRUE;
m_fontT.CreateFontIndirect(&lf);
方法三
CFont* pFont = CFont::FromHandle(hFont);
LOGFONT lf;
pFont->GetLogFont(&lf);
m_fontN.CreateFontIndirect(&lf);
lf.lfUnderline = TRUE;
m_fontT.CreateFontIndirect(&lf);
一、列表控件有两种自绘:
a)OwnerDraw Data
: 海量数据或者虚拟列表(a virtual list view
)
是用于海量数据填充,例如你有2亿条数据要统统插入到列表,
耗时可能是10分钟甚至更多的数据万亿条数据要耗费更长时间。
OwnerDraw Data
的使用方法设置了该属性的列表控件,只要调用SetItemCount
。
当你拖动滚动栏时,自动显示对应的一页数据。
b)OwnerDraw Fix
:是自绘列表。
二、下拉列表:
a)OwnerDraw Fix
:是系统自动管理下拉项的高度;
a)OwnerDraw Variable
:通过MeasureItem函数来管理下拉项的高度;