+ Reply to Thread
Results 1 to 3 of 3

Scroll through items in a drop down from a button.

  1. #1
    quartz
    Guest

    Scroll through items in a drop down from a button.

    I am using Office 2003 on Windows XP.

    I have a dropdown control on a custom toolbar that is populated with some
    items.
    I also have a button, which when the user clicks it, I would like the next
    item in the drop down to become selected (like a scrolling button), so the
    user can quickly scroll through the list, making each next item the item
    selected in the drop down.

    The user also needs to be able to access the drop down in the customary way.

    Can someone please post example code to do this?

    Thanks.

  2. #2
    Die_Another_Day
    Guest

    Re: Scroll through items in a drop down from a button.

    Sub IncrementCombo()
    With Application.CommandBars("Your ToolBar").Controls("Your ComboBox")
    .ListIndex = .ListIndex + 1
    End With
    End Sub

    Try that

    Charles
    quartz wrote:
    > I am using Office 2003 on Windows XP.
    >
    > I have a dropdown control on a custom toolbar that is populated with some
    > items.
    > I also have a button, which when the user clicks it, I would like the next
    > item in the drop down to become selected (like a scrolling button), so the
    > user can quickly scroll through the list, making each next item the item
    > selected in the drop down.
    >
    > The user also needs to be able to access the drop down in the customary way.
    >
    > Can someone please post example code to do this?
    >
    > Thanks.



  3. #3
    NickHK
    Guest

    Re: Scroll through items in a drop down from a button.

    You should put a check for the end of the list to start at the top again, or
    stop at the bottom

    Sub IncrementCombo()
    With Application.CommandBars("Your ToolBar").Controls("Your ComboBox")
    If .ListIndex = .ListCount-1 then
    .ListIndex =0
    Else
    .ListIndex + 1
    End If
    End With
    End Sub

    NickHK

    "Die_Another_Day" <[email protected]> wrote in message
    news:[email protected]...
    > Sub IncrementCombo()
    > With Application.CommandBars("Your ToolBar").Controls("Your ComboBox")
    > .ListIndex = .ListIndex + 1
    > End With
    > End Sub
    >
    > Try that
    >
    > Charles
    > quartz wrote:
    > > I am using Office 2003 on Windows XP.
    > >
    > > I have a dropdown control on a custom toolbar that is populated with

    some
    > > items.
    > > I also have a button, which when the user clicks it, I would like the

    next
    > > item in the drop down to become selected (like a scrolling button), so

    the
    > > user can quickly scroll through the list, making each next item the item
    > > selected in the drop down.
    > >
    > > The user also needs to be able to access the drop down in the customary

    way.
    > >
    > > Can someone please post example code to do this?
    > >
    > > Thanks.

    >




+ 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