Click to See Complete Forum and Search --> : Problem wih HScroll of ComboBox
Gregory64
August 8th, 1999, 05:49 PM
I have Form View with ComboBox, I've checked auto HScroll property of ComboBox and I've call CComboBox::SetHorizontalExtent(int) and set length of my biggest string in picksels but HScrollBar never appear. Help me pls.
Vikram
August 27th, 1999, 10:50 AM
Hi,
I think there is a problem . I to tried with the same but the horizontal scrollbar does not appear.
The solution to this is open the .RC file in text mode and add WS_HSCROLL to the styles of the combo box.
Keep rest of the styles as it is
"CBS_AUTOHSCROLL| CBS_SORT | WS_VSCROLL | WS_TABSTOP
To the above style add WS_HSCROLL.
and that works. U will see the Horizontal scrollbar for ur Combobox.
Also call the SetHorizontalExtent
Reply me wether it worked for u
-Regards
Vikram
Gregory64
August 28th, 1999, 02:16 PM
Hi,
Thank you very much, now it's works.
But I'm still wondering two thinks
1. Why there is no property for this style in property box.
2. Can I do it programmatically, I've tried thinks like below but it doesn't works
CComboBox* pCombo=(CComboBox*) GetDlgItem(IDC_COMBO1);
DWORD style=pCombo->GetStyle();
pCombo->ModifyStyle(style,style|WS_HSCROLL);
Thanks one more time.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.