combo box
CComboBox m_combobox;
m_combobox.AddString(L"COM0");
m_combobox.AddString(L"COM1");
m_combobox.AddString(L"COM2");
m_combobox.AddString(L"COM3");
m_combobox.AddString(L"COM4");
m_combobox.AddString(L"COM5");
m_combobox.AddString(L"COM6");
m_combobox.AddString(L"COM7");
m_combobox.AddString(L"COM8");
m_combobox.SetCurSel(8);
m_combobox.GetCurSel(8);
m_ComboBox.ResetContent();//清除combobox 的所有内容
m_ComboBox.GetCount();//取得目前已经有的行
m_ComboBox.DeleteString( UINT nIndex )//删除指定行,
m_cbExample.InsertString( nIndex, “StringData” );
获取当前内容
m_ComboBox.GetWindowText(strTemp);
获取其他行内容
m_ComboBox.GetLBText(n,strTemp);
画combo box控件的时候,鼠标点击combo box的箭头位置,然后调整高度到一定高度即可。
GetDlgItem(static text id)->SetWindowText(_T("文本内容"));
edit control
GetDlgItem(editID)->SetWindowText(_T("文本内容"));
static control
//设置字体
CFont * f = new CFont;
f->CreateFont(16,0,0,0,FW_BOLD,false,false,0,
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
_T("Arial"));// lpszFac
GetDlgItem(IDC_STATIC_WARING)->SetFont(f);