How to disable the dropdown arrow of a combo box?
-
Hello, there, I am currently working on a project. There is a combo box. I'd like to know how I can disable the dropdown arrow of it or hide the dropdown arrow. In my project there is two setting, one is keeping the input history, one is not keeping the input history. I tried m_Combo.ShowDropDown(false)when not keeping the history, but there is a black line under it and it doesn't look good. Is there a way to solve this problem? Thanks a lot in advance. Bin
-
Hello, there, I am currently working on a project. There is a combo box. I'd like to know how I can disable the dropdown arrow of it or hide the dropdown arrow. In my project there is two setting, one is keeping the input history, one is not keeping the input history. I tried m_Combo.ShowDropDown(false)when not keeping the history, but there is a black line under it and it doesn't look good. Is there a way to solve this problem? Thanks a lot in advance. Bin
-
Hello, there, I am currently working on a project. There is a combo box. I'd like to know how I can disable the dropdown arrow of it or hide the dropdown arrow. In my project there is two setting, one is keeping the input history, one is not keeping the input history. I tried m_Combo.ShowDropDown(false)when not keeping the history, but there is a black line under it and it doesn't look good. Is there a way to solve this problem? Thanks a lot in advance. Bin
If your wanting to disable it do this have a combo box and give it a control name like m_example then on your button or whatever your using lets say your using a button and the button is called History you put under OnHistory() m_example.EnableWindow(FALSE); // disabled combobox or whatever linked to m_example.EnableWindow(TRUE); // enables combobox or whatever linked to now if you wanna hide it all together i would do this under the OnHistory() m_example.ShowWindow(SW_HIDE); // hides the combobox or whatever linked to if you want the window back then m_example.ShowWindow(SW_SHOW);// shows the combobox or whatever linked to GOOD LUCK, HOPE THIS HELPS. Win32newb "Making windows programs worse than they already are"
-
If your wanting to disable it do this have a combo box and give it a control name like m_example then on your button or whatever your using lets say your using a button and the button is called History you put under OnHistory() m_example.EnableWindow(FALSE); // disabled combobox or whatever linked to m_example.EnableWindow(TRUE); // enables combobox or whatever linked to now if you wanna hide it all together i would do this under the OnHistory() m_example.ShowWindow(SW_HIDE); // hides the combobox or whatever linked to if you want the window back then m_example.ShowWindow(SW_SHOW);// shows the combobox or whatever linked to GOOD LUCK, HOPE THIS HELPS. Win32newb "Making windows programs worse than they already are"
-
thanks a lot. But I just want to disable the drop down button and make it work as an edit box. I don't want to disable the whole thing. Thanks.
what you can do is: Just iterate the windows of the combo box. Combo box contains the edit box and the button. For example char szClassName[256]; CWnd* pWnd=(CWnd *)m_combo.GetWindow(GW_CHILD); ::GetClassName(pWnd->GetSafeHwnd(), szClassName, 256); while( strcmp( szClassName,_T("Button")) != 0 ) { pWnd=(CWnd *)m_combo.GetWindow(GW_HWNDNEXT); } //Got the button if( pWnd ) pWnd->ShowWindow( SW_HIDE );
-
what you can do is: Just iterate the windows of the combo box. Combo box contains the edit box and the button. For example char szClassName[256]; CWnd* pWnd=(CWnd *)m_combo.GetWindow(GW_CHILD); ::GetClassName(pWnd->GetSafeHwnd(), szClassName, 256); while( strcmp( szClassName,_T("Button")) != 0 ) { pWnd=(CWnd *)m_combo.GetWindow(GW_HWNDNEXT); } //Got the button if( pWnd ) pWnd->ShowWindow( SW_HIDE );