Results 1 to 18 of 18

Thread: VB6 Simple Virtual ComboBox (OwnerDrawn)

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    VB6 Simple Virtual ComboBox (OwnerDrawn)

    As the title says, a simple approach to accomplish ownerdrawing from Data in external Data-Containers
    in a "DropDown-scenario".

    As usual with virtual (bound) Controls, they are internally lightweight, since the Drawing happens on the outside.

    Nevertheless (depending on what the OwnerDraw-Event offers), a typical scenario
    can usually be implemented in only a few lines of OwnerDraw-Handler-Code -
    right on the Data of your exernal DataSource-Container (be that an Array, a Collection or a Recordset).

    The implementation below is based on only about 140 Lines of UserControl-Code.
    Feel free to swap the SubClasser (Tricks clsSubClass currently) to your own implementation, if you like...

    And since "Multi-Select-DropDown-scenarios" are apparently "en vouge" these days,
    the Control supports this as well - as the ScreenShot below shows:


    Ok, here's the Demo-Code: VirtualCombo.zip

    Have fun with it...

    Edit: enhancement of the MinVisibleItems-Prop, to work also in non-manifested environments.
    Edit2: MouseWheel-based Scrolling now updates the currently selected Item-under the Mouse + additional Event (MouseMoveOnItem, to address Hover-Areas within a given Item)

    Olaf
    Last edited by Schmidt; Jul 22nd, 2018 at 11:41 AM.

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