CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 1999
    Posts
    427

    Problem wih HScroll of ComboBox

    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.



  2. #2
    Join Date
    Apr 1999
    Location
    India, Presently in UK
    Posts
    12

    Re: Problem wih HScroll of ComboBox

    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


  3. #3
    Join Date
    Aug 1999
    Posts
    427

    Re: Problem wih HScroll of ComboBox

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured