图片在选项卡控件上不可见 [英] Images are not visible on tab control
本文介绍了图片在选项卡控件上不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
已经编写了以下代码,我能够看到选项卡,但只有文本而不是图像
IDB_BITMAP是尺寸为96 * 32的图像;
have written following code,I am able to see tabs but with only text not images
IDB_BITMAP is image of size 96*32;
CImageList ci;
ci.Create(IDB_BITMAP1,32,1,RGB(255,0,0));
m_tab.SetImageList(&ci);
m_tab.InsertItem(1,_T("one"),0);
m_tab.InsertItem(2,_T("two"),1);
m_tab.InsertItem(3,_T("three"),2);
请帮助解决此问题.
还有一个问题,如何使用此选项卡式页面,是否可以将其他控件(如按钮列表框等)放置在选项卡上,如果可以,如何?
Please help on this issue.
One More Question ,how I can use this tabbed pages,Can I place other controls like button listbox etc on tab,if yes how ?
推荐答案
您正在创建图像列表上的列表,离开范围时销毁该列表.使用CImageList
成员变量.
您可以查看CPropertySheet
和CPropertyPage
类,以基于可能包含各种控件的对话框资源创建选项卡式页面.请参阅CPropertyPage::GetTabControl()
以访问属性页的选项卡控件.
You are creating the image list on the stack and the list is destroyed when leaving the scope. Use aCImageList
member variable.
You may have a look at theCPropertySheet
andCPropertyPage
classes to create tabbed pages based on dialog resources that may contain all kinds of controls. SeeCPropertyPage::GetTabControl()
to access the tab control of a property sheet.
这篇关于图片在选项卡控件上不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文