65.9K
CodeProject 正在变化。 阅读更多。
Home

带位图的组合框

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.75/5 (6投票s)

1999年11月25日

viewsIcon

337597

downloadIcon

6681

可用于显示位图的组合框。

Sample Image

此控件是在 Joel Wahlberg 的实用 图标选择组合框 的基础上制作的。

用法

  1. 在您的项目中包含 CBitmapPickerCombo.cppCBitmapPickerCombo.h
  2. 在资源编辑器中,创建一个常规 combobox,至少具有以下样式:DropListOwnerDraw Variable、包含字符串
  3. 在 VC 的类向导中为 combobox 创建控件成员变量
  4. 在对话框的 .h 文件中,将 CComboBox 替换为 CBitmapPickerCombo
  5. OnInitDialog 中,使用 AddBitmapInsertBitmap 成员函数向 combobox 添加 CBitmap(以及可选字符串)

combobox 的高度会自动设置为最高的位图高度。

相关成员函数原型

int CBitmapPickerCombo::AddBitmap(const CBitmap *bitmap, const char *string = NULL);
int CBitmapPickerCombo::InsertBitmap
    (int nIndex, const CBitmap *bitmap, const char *string = NULL);

许可证

本文没有明确的许可证附加到它,但可能包含文章文本或下载文件本身中的使用条款。如有疑问,请通过下面的讨论区联系作者。作者可能使用的许可证列表可以在 此处 找到。

© . All rights reserved.