Deriving Combobox items indexes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Easton

    #1

    Deriving Combobox items indexes

    To anyone who might be able to help.

    I'm trying to derive the index of any random item in a populated combobox
    dropdownlist when the mousepointer is over the item. Seems to me it should
    be possible since the item "highlights " when the mouse passes over the
    different items listed, but the end user hasn't yet "clicked/selected" any
    specific item. I know it can be done with a listbox. Basically looking for
    the LB_ITEMFROMPOIN T equivalent for Comboboxes. Does anyone have any idea
    how to accomplish this with a combobox? Please help.
  • Cor Ligthert [MVP]

    #2
    Re: Deriving Combobox items indexes

    Easton,

    Any reason that you want to do this, it sound for me forever stupid that
    people want to confrontate users with non standard behaviour. Something from
    the 80's in the previous century.

    Cor

    "Easton" <Easton@discuss ions.microsoft. comschreef in bericht
    news:5254EA53-028F-4A16-BD71-F925C4168C1D@mi crosoft.com...
    To anyone who might be able to help.
    >
    I'm trying to derive the index of any random item in a populated combobox
    dropdownlist when the mousepointer is over the item. Seems to me it
    should
    be possible since the item "highlights " when the mouse passes over the
    different items listed, but the end user hasn't yet "clicked/selected" any
    specific item. I know it can be done with a listbox. Basically looking
    for
    the LB_ITEMFROMPOIN T equivalent for Comboboxes. Does anyone have any
    idea
    how to accomplish this with a combobox? Please help.

    Comment

    • Phill W.

      #3
      Re: Deriving Combobox items indexes

      Easton wrote:
      I'm trying to derive the index of any random item in a populated combobox
      dropdownlist when the mousepointer is over the item. Seems to me it should
      be possible since the item "highlights " when the mouse passes over the
      different items listed, but the end user hasn't yet "clicked/selected" any
      specific item.
      If you create a Control derived from ComboBox, make it OwnerDrawn and
      override the DrawItem method, you should be able to pick out the
      currently "hovered" item based on each item's style. (IIRC, the item's
      index is passed as part of the Event Arguments).

      Not something to take on lightly, but it you /really want to...

      Regards,
      Phill W.

      Comment

      • Easton

        #4
        Re: Deriving Combobox items indexes

        Yes, my application would use the index to derive a preview of information to
        help the end user make the best possible choice from the combobox.

        "Cor Ligthert [MVP]" wrote:
        Easton,
        >
        Any reason that you want to do this, it sound for me forever stupid that
        people want to confrontate users with non standard behaviour. Something from
        the 80's in the previous century.
        >
        Cor
        >
        "Easton" <Easton@discuss ions.microsoft. comschreef in bericht
        news:5254EA53-028F-4A16-BD71-F925C4168C1D@mi crosoft.com...
        To anyone who might be able to help.

        I'm trying to derive the index of any random item in a populated combobox
        dropdownlist when the mousepointer is over the item. Seems to me it
        should
        be possible since the item "highlights " when the mouse passes over the
        different items listed, but the end user hasn't yet "clicked/selected" any
        specific item. I know it can be done with a listbox. Basically looking
        for
        the LB_ITEMFROMPOIN T equivalent for Comboboxes. Does anyone have any
        idea
        how to accomplish this with a combobox? Please help.
        >
        >
        >

        Comment

        • Easton

          #5
          Re: Deriving Combobox items indexes

          Thank you Phill, I've been headed in that direction as well. Would you
          happend to know what event I should be watching?

          "Phill W." wrote:
          Easton wrote:
          >
          I'm trying to derive the index of any random item in a populated combobox
          dropdownlist when the mousepointer is over the item. Seems to me it should
          be possible since the item "highlights " when the mouse passes over the
          different items listed, but the end user hasn't yet "clicked/selected" any
          specific item.
          >
          If you create a Control derived from ComboBox, make it OwnerDrawn and
          override the DrawItem method, you should be able to pick out the
          currently "hovered" item based on each item's style. (IIRC, the item's
          index is passed as part of the Event Arguments).
          >
          Not something to take on lightly, but it you /really want to...
          >
          Regards,
          Phill W.
          >

          Comment

          Working...