The Study of Programming Windows with MFC--Imagelist and ComboBoxEx
2010-08-09 10:13
639 查看
1.Imagelist
CImagelist m_il;
m_il.Create(IDB_BITMAP, 18, 1, CLR_NONE);
m_il.Draw(pDC, 2, point, ILD_NORMAL);
2.ComboBoxEx
CImagelist m_il;
m_il.Create(IDB_BITMAP, 18, 1, CLR_NONE);
CComboBoxEx m_wndcbEx;
m_wndcbEx.SetImageList(&m_il);
for(int i=0;i<5;i++)
{
CString string;
string.Format(_T("Item %d"),i);
COMBOBOXEXITEM cbei;
cbei.mask = CBEIF_IMAGE ¦ CBEIF_SELECTEDIMAGE ¦ CBEIF_TEXT // |CBEIF_INDENT;
cbei.iItem = i;
cbei.pszText = (LPTSTR) (LPCTSTR) string;
cbei.iImage = 0;
cbei.iSelectedImage = 0;
// cbei.Indent=i;
m_wndcbEx.InsetItem(&cbei);
}
CImagelist m_il;
m_il.Create(IDB_BITMAP, 18, 1, CLR_NONE);
m_il.Draw(pDC, 2, point, ILD_NORMAL);
2.ComboBoxEx
CImagelist m_il;
m_il.Create(IDB_BITMAP, 18, 1, CLR_NONE);
CComboBoxEx m_wndcbEx;
m_wndcbEx.SetImageList(&m_il);
for(int i=0;i<5;i++)
{
CString string;
string.Format(_T("Item %d"),i);
COMBOBOXEXITEM cbei;
cbei.mask = CBEIF_IMAGE ¦ CBEIF_SELECTEDIMAGE ¦ CBEIF_TEXT // |CBEIF_INDENT;
cbei.iItem = i;
cbei.pszText = (LPTSTR) (LPCTSTR) string;
cbei.iImage = 0;
cbei.iSelectedImage = 0;
// cbei.Indent=i;
m_wndcbEx.InsetItem(&cbei);
}
相关文章推荐
- The Study of Programming Windows with MFC--Progress and Animate control
- The study of Programming Windows with MFC--Ip Address control and Date control
- The study of chapter 13 in programming windows with mfc-printing with document and views
- The study of Programming Windows with MFC-Palette
- The study of Programming Windows with MFC--BitMap
- The study of Programming Windows with MFC--print's example
- The Study of Programming Windows with MFC--Slider,Spin,ToolTip
- The study of Programming Windows with MFC
- The study of Programming Windows with MFC-printing tips
- The study of Programming Windows with MFC--CRgn
- The study of Programming Windows with MFC--Common Control
- The Study of Programming Windows with MFC--Bitmap2
- the study of programmng windows with mfc--timer
- (翻译)Tricks of the windows game programming Gurus(Windows游戏大师之路) --- 第三章(作者:ANDRE LAMOTHE 1999)
- The Essence of Object-Oriented Programming with Java and UML
- Programming Windows with MFC - Capter 10. Scroll Views, HTML Views, and Other View Types
- The Introduction of Windows Programming and WTL
- The study of list ,tuple and conditional statement in Python(20170905)
- (翻译)Tricks of the windows game programming Gurus(Windows游戏大师之路) --- 前言(作者:ANDRE LAMOTHE 1999)
- Test-Driven C# Improve the Design and Flexibility of Your Project with Extreme Programming Techniques