⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 combo_dropdown_dropdownlist.shtml.htm

📁 随书类文件![随书类]MFC_SOURCEBOOK
💻 HTM
字号:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Zafir Anjum">
   <TITLE>Controls - ComboBox - Switch between drop down & drop list mode</TITLE>
</HEAD>
<body background="../fancyhome/back.gif" tppabs="http://www.codeguru.com/fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000">
<table WIDTH="100%">
<tr WIDTH="100%">
<td><td>
</tr>
</table>


<CENTER><H3><FONT COLOR="#AOAO99">ComboBox - Switch between drop down & drop list mode</FONT></H3></CENTER>
<HR>




This article was contributed by <A HREF="mailto:R.Cremer@gmx.net">Robert Cremer</A>.


<P>I took the hint of Moshe Stolar to display black text in a disabled ComboBox to
develope a small class whith more color control.
In addition it can act like a drop down list an You may switch between
drop down box mode and drop list mode with a simple call to SetReadOnly().


<PRE><TT><FONT COLOR="#990000">
//////////////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MYCOMBOBOX_H__75106EA1_6649_11D1_95E5_0060971F6E1E__INCLUDED_)
#define AFX_MYCOMBOBOX_H__75106EA1_6649_11D1_95E5_0060971F6E1E__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

// MyComboBox.h : header file
//

// CMyComboBox window

// Author: Robert Cremer

// A ComboBox with easy to switch between edit mode and non edit mode.
// (i. e. works like a drop down or a drop list)
// The ComboBox has real coloring, working in drop down and drop list mode.
// !!! The Box must not be a drop list (CBS_DROPDOWNLIST) !!!
// Working as a drop list can be done with a call to SetReadOnly()
// or with the CTor param false.
class CMyComboBox : public CComboBox
{
// Attributes
private:
牋 // default colors
牋 enum
牋 {
牋牋

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -