Combobox Manipulation - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Combobox Manipulation

[b]VB5[/b]

What I've done; Dim CurrentMonth as string. I have a combobox for users to choose which month they want as CurrenMonth. I want the combobox to set the current month as the primary choice.

I did this once before but can't remember how and I can't remember where I found it. It's hell getting old, people. They say memory is the second thing to go, and I can't remember what the first thing was. lol

Comments

  • pseudocoderpseudocoder Posts: 688Member ✭✭✭
    Yea; I'll second getting old is awful - my memory is terrible and gets worse every day. :)

    In the combo's click event, try

    [code]
    CurrentMonth = Combo1.List(Combo1.ListIndex)
    [/code]

    HTH
  • GiftedSailorGiftedSailor Posts: 5Member


    Thank you for your input. It struck a chord in my Swiss cheese of a brain and I played with it for a bit. Here's what I finally came up with:

    cboMonth.ListIndex = (CurrentMonth - 1)
    cboYear.ListIndex = (CurrentYear - 2010)

    Thanks again
Sign In or Register to comment.