VOID CMyDlg::SetDropDownList(CComboBox* pComboBox)
{
DWORD theStyle;
HWND theChild;
theChild = ::GetWindow(pComboBox->m_hWnd, GW_CHILD);
theStyle = GetWindowLong(pComboBox->m_hWnd, GWL_STYLE);
theStyle &= ~CBS_DROPDOWN; //去掉DROPDOWN
theStyle |= CBS_DROPDOWNLIST; //添加DROPDOWNLIST
::DestroyWindow(theChild);
SetWindowLong(pComboBox->m_hWnd, GWL_STYLE, theStyle);
}
设置对话框ComboBox控件为下拉列表
由
·
发表回复