+ Reply to Thread
Results 1 to 5 of 5

remove horizontal scrollbar combobox

  1. #1
    RB Smissaert
    Guest

    remove horizontal scrollbar combobox

    On a Excel VBA userform I have a Combobox holding a
    number of years as long numbers in the format yyyy.
    These number are in a 1-D array.
    The combobox properties are set in the UserForm initialize event like this,
    showing only the essential bits:

    Private Sub UserForm_Initialize()

    Dim i As Long

    With MonthView1
    .Appearance = cc23D
    End With

    For i = 1 To 111
    arrYears(i) = Year(Date) - (101 - i)
    Next

    With ComboBox1
    .List = arrYears
    .Value = Year(Date)
    .ListIndex = 100
    .ListWidth = 48
    End With

    End Sub

    Now when I click the combobox dropdown button the list will have a
    horizontal scrollbar, which I don't need
    and which looks messy. I am not sure why it shows as all the years show
    fully and the width is only 4 characters.
    I even tried get rid of it with the Windows API, but no luck yet.
    How do I do this?


    RBS




  2. #2
    sheeba
    Guest

    Re: remove horizontal scrollbar combobox

    Try this:

    Check the properties of the combobox for ColumnWidthe and write the
    width of the combo box there..


  3. #3
    RB Smissaert
    Guest

    Re: remove horizontal scrollbar combobox

    Thanks. That was indeed the one I needed.
    Quite a bit simpler than using the API ...

    RBS

    "sheeba" <[email protected]> wrote in message
    news:[email protected]...
    > Try this:
    >
    > Check the properties of the combobox for ColumnWidthe and write the
    > width of the combo box there..
    >



  4. #4
    Tom Ogilvy
    Guest

    Re: remove horizontal scrollbar combobox

    Especially since the MSforms controls can't be manipulated with the Windows
    API since they are windowless.

    --
    Regards,
    Tom Ogilvy

    "RB Smissaert" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks. That was indeed the one I needed.
    > Quite a bit simpler than using the API ...
    >
    > RBS
    >
    > "sheeba" <[email protected]> wrote in message
    > news:[email protected]...
    > > Try this:
    > >
    > > Check the properties of the combobox for ColumnWidthe and write the
    > > width of the combo box there..
    > >

    >




  5. #5
    RB Smissaert
    Guest

    Re: remove horizontal scrollbar combobox

    That is what I thought, but I think I managed to get the hwnd.

    RBS


    "Tom Ogilvy" <[email protected]> wrote in message
    news:%[email protected]...
    > Especially since the MSforms controls can't be manipulated with the
    > Windows
    > API since they are windowless.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "RB Smissaert" <[email protected]> wrote in message
    > news:[email protected]...
    >> Thanks. That was indeed the one I needed.
    >> Quite a bit simpler than using the API ...
    >>
    >> RBS
    >>
    >> "sheeba" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Try this:
    >> >
    >> > Check the properties of the combobox for ColumnWidthe and write the
    >> > width of the combo box there..
    >> >

    >>

    >
    >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1