Click here to Skip to main content
15,915,800 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Add MFC support to ATL project Pin
Rama Krishna Vavilala13-Jun-02 1:02
Rama Krishna Vavilala13-Jun-02 1:02 
GeneralRe: Add MFC support to ATL project Pin
Nish Nishant13-Jun-02 1:23
sitebuilderNish Nishant13-Jun-02 1:23 
GeneralRe: Add MFC support to ATL project Pin
Rama Krishna Vavilala13-Jun-02 1:17
Rama Krishna Vavilala13-Jun-02 1:17 
GeneralRe: Add MFC support to ATL project Pin
Nish Nishant13-Jun-02 1:31
sitebuilderNish Nishant13-Jun-02 1:31 
GeneralDynamically Changing CComboBox From Dropdown To Droplist Pin
John Clump13-Jun-02 0:45
John Clump13-Jun-02 0:45 
GeneralRe: Dynamically Changing CComboBox From Dropdown To Droplist Pin
Nish Nishant13-Jun-02 1:00
sitebuilderNish Nishant13-Jun-02 1:00 
GeneralRe: Dynamically Changing CComboBox From Dropdown To Droplist Pin
srinivas vaithianathan13-Jun-02 8:22
srinivas vaithianathan13-Jun-02 8:22 
GeneralRe: Dynamically Changing CComboBox From Dropdown To Droplist Pin
Phil J Pearson17-Jun-02 6:23
Phil J Pearson17-Jun-02 6:23 
You cannot change this style at runtime. You have the right idea: delete the combobox and create another with the appropriate style. First save all the relevant attributes of the original combo and stuff them into the new one when it's ready. I used the following code to change from DROPDOWN to DROPLIST:

// save all the relevant attributes of the existing combo, then destroy it and
// create a new one with CBS_DROPDOWNLIST style.
// (ModifyStyle(CBS_DROPDOWN, CBS_DROPDOWNLIST) won't work)
DWORD dwStyle = m_Combo.GetStyle();
DWORD dwExStyle = m_Combo.GetExStyle();
int nID = m_Combo.GetDlgCtrlID();
CWnd *pPrevWindow = m_Combo.GetNextWindow(GW_HWNDPREV);
CWnd *pParentWnd = m_Combo.GetParent();
CFont *pFont = m_Combo.GetFont();
m_Combo.GetWindowRect(rect);
pParentWnd->ScreenToClient(rect);
m_Combo.DestroyWindow();
dwStyle &= ~CBS_DROPDOWN;
dwStyle |= CBS_DROPDOWNLIST;
m_Combo.CreateEx(dwExStyle, "COMBOBOX", "", dwStyle, rect, pParentWnd, nID);
m_Combo.SetFont(pFont, FALSE);
m_Combo.SetWindowPos(pPrevWindow, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);


Hope this helps,


Regards,
Phil
GeneralRe: Dynamically Changing CComboBox From Dropdown To Droplist Pin
John Clump17-Jun-02 20:02
John Clump17-Jun-02 20:02 
GeneralAbout WebBrowser control Pin
sundararaman13-Jun-02 0:01
sundararaman13-Jun-02 0:01 
Generala question in visual studio.net! Pin
G.Richard12-Jun-02 23:49
G.Richard12-Jun-02 23:49 
GeneralRe: a question in visual studio.net! Pin
Rama Krishna Vavilala13-Jun-02 1:18
Rama Krishna Vavilala13-Jun-02 1:18 
GeneralRe: a question in visual studio.net! Pin
G.Richard13-Jun-02 21:42
G.Richard13-Jun-02 21:42 
GeneralCurrent Directory run time Pin
12-Jun-02 23:03
suss12-Jun-02 23:03 
GeneralRe: Current Directory run time Pin
Renjith Ramachandran12-Jun-02 23:07
Renjith Ramachandran12-Jun-02 23:07 
GeneralRe: Current Directory run time Pin
Fredrik Skog13-Jun-02 0:33
Fredrik Skog13-Jun-02 0:33 
GeneralRe: Current Directory run time Pin
Rama Krishna Vavilala13-Jun-02 1:32
Rama Krishna Vavilala13-Jun-02 1:32 
GeneralRe: Current Directory run time Pin
Fredrik Skog13-Jun-02 2:06
Fredrik Skog13-Jun-02 2:06 
GeneralRe: Current Directory run time Pin
dazinith13-Jun-02 3:24
dazinith13-Jun-02 3:24 
GeneralRe: Current Directory run time Pin
Fredrik Skog13-Jun-02 3:43
Fredrik Skog13-Jun-02 3:43 
GeneralRe: Current Directory run time Pin
JohnnyG13-Jun-02 3:41
JohnnyG13-Jun-02 3:41 
GeneralRe: Current Directory run time Pin
lucy13-Jun-02 5:00
lucy13-Jun-02 5:00 
GeneralRe: Current Directory run time Pin
Chris Losinger13-Jun-02 5:07
professionalChris Losinger13-Jun-02 5:07 
GeneralRe: Current Directory run time Pin
lucy13-Jun-02 6:05
lucy13-Jun-02 6:05 
GeneralRe: Current Directory run time Pin
srinivas vaithianathan13-Jun-02 8:26
srinivas vaithianathan13-Jun-02 8:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.