Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

VB6 Simple Virtual ComboBox (OwnerDrawn)

$
0
0
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
Attached Files

Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>