📄 ccombobox.hpp
字号:
#ifndef _CCOMBOBOX_HPP
#define _CCOMBOBOX_HPP
#include "CWnd.hpp"
#include "CString.hpp"
class CComboBox : public CWnd {
public:
// Constructors
CComboBox() {}
CComboBox(CWnd& father,int nID) : CWnd(father,nID) {}
// This seems to be very useful
CComboBox& operator=(LPTSTR txt) { SetText(txt); return *this; }
CComboBox& operator=(CString& txt) { SetText(txt); return *this; }
// To limit text length
void SetLimitText(int max) { SendMessage(EM_SETLIMITTEXT,(WPARAM)max*sizeof(TCHAR),(LPARAM)0);}
// Useful fns
void SetCurSel(UINT Sel) { SendMessage(CB_SETCURSEL,(WPARAM) Sel,(LPARAM)0); }
UINT GetCurSel() { return SendMessage(CB_GETCURSEL,(WPARAM) 0,(LPARAM)0); }
void AddString(LPTSTR String) { SendMessage(CB_ADDSTRING,(WPARAM)0,(LPARAM)String); }
void AddString(CString& String) { SendMessage(CB_ADDSTRING,(WPARAM)0,(LPARAM)String.Ptr()); }
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -