Important alert: (current site time 7/16/2013 2:41:54 AM EDT)
 

winzip icon

MorphListBox 1.21 - Graphical Listbox UserControl

Email
Submitted on: 4/4/2007 8:52:07 PM
By: Option Explicit 
Level: Intermediate
User Rating: By 56 Users
Compatibility: VB 6.0
Views: 42154
author picture
(About the author)
 
     (Added .Sort method) A purely graphical replacement/enhancement for the VB single-column listbox control. Standard vertical listbox behavior is consistently emulated, with the exception of a couple intricacies of list item selection in .MultiSelect = Extended mode. Control features an integrated graphical vertical scrollbar. Custom .FindIndex and .MouseOverIndex methods. Background can be a gradient or bitmap. Small bitmaps can be tiled or stretched to fit the display area. Each listitem can have an associated icon displayed next to it. Eight gradient color schemes can be selected via the .Theme property. Unicode display supported. Drag and drop capability incorporated. Numeric list sorting option. .DisplayFrom method allows you to display any part of the list through code. .RightToLeft allows smooth, natural operation for those whose written language goes from right to left. Loads lists several times faster than traditional VB listbox, depending on your system. Due to size of control, this is best used as a compiled .OCX. As always, constructive feedback welcome, votes appreciated.

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :MorphListBox 1.21 - Graphical Listbox UserControl
'**************************************
Lots and lots.
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 8 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
10/1/2005 1:30:13 PMRichard Mewett

Great control. Excellent replication of VB Listbox functionality to ease transition and smooth graphics renedering. Like the owner drawn scrollbars & bitmap tiling! 5* from me...
(If this comment was disrespectful, please report it.)

 
10/1/2005 2:00:36 PMLibor Blaheta

I like it, it looks like from sci-fi. :-)
(If this comment was disrespectful, please report it.)

 
10/1/2005 2:41:16 PMAdlib Logic

Most impressive! Much better than the VB listbox, but what a lot of work just to make a nice list! 5 globules from me!
(If this comment was disrespectful, please report it.)

 
10/1/2005 2:47:36 PMjeremyxtz

How many more of these write-it-in-five-minutes submissions are we going to be subjected to. Sigh...

(Only kidding! What else but 5!)
(If this comment was disrespectful, please report it.)

 
10/1/2005 2:48:22 PMOption Explicit

Adlib you ain't kidding. I knew it would be a large project but I was looking at the complexity more from the graphical scrollbar viewpoint tan anything else. As usual, the intrinsic VB common controls that we take so much for granted are far more complex than they seem at first glance. Thanks.
(If this comment was disrespectful, please report it.)

 
10/1/2005 2:49:46 PMOption Explicit

Libor, thanks. Since you always inquire about Unicode I'd appreciate your feedback regarding proper Unicode display.
(If this comment was disrespectful, please report it.)

 
10/1/2005 2:50:30 PMOption Explicit

Jeremy, actually it took 10 minutes, not 5 :)
(If this comment was disrespectful, please report it.)

 
10/1/2005 4:51:16 PMJim Jose

And now the 'MorphListBox' is released. Very nice!, and here is ur well deserved 5 starts *****. Hey, I like ur new auther pic too... :)
(If this comment was disrespectful, please report it.)

 
10/1/2005 4:58:38 PMCarles P.V.

Nicely done: clean code, well structured, consistent and clear variable/routine naming... so easy to read and follow. Have you encountered difficulties at time to emulate scrollbar? You are right: those intrinsic *controls that we take so much for granted are quite more complex than they seem at first glance*.
And thanks for credit :-) (something sadly quite unusual).
(If this comment was disrespectful, please report it.)

 
10/1/2005 5:47:41 PMOption Explicit

Thanks Jim! The author pic is a very bizarre comic strip character named Zippy The Clown. Glad you like it! And I hope your McListBox won a COTM! Carles, thanks also. The scrollbar was a bit difficult but I broke it down into little bitty component parts and that really made it easier. My motto with this control while I was developing it was "Slow and steady, a little progress each day, and don't worry about how big the code gets." The hardest part was just trying to emulate the list manipulation aspects of the intrinsic vb listbox.
(If this comment was disrespectful, please report it.)

 
10/1/2005 6:03:52 PMCarles P.V.

Selection modes? And especially 'extended' mode?
(If this comment was disrespectful, please report it.)

 
10/1/2005 6:09:45 PMOption Explicit

Yes, that's another reason this control's code is so segmented. As it turns out a listbox is actually four listboxes in one. MultiSelect None, Simple, Extended and also CheckBox mode. Each has their own way of managing .ListIndex, .SelCount, selection highlight, focus rectangle, etc. That's why there are so many routines like "ProcessMouseDown_MultiSelectExtended" etc. because if I just had a ProcessMouseDown it would be a nightmarish nested 'If block' scenario. Best to just farm it all out to little routines even if it does add some to 'code bloat'.
(If this comment was disrespectful, please report it.)

 
10/1/2005 6:25:11 PMOption Explicit

Correction: The clown in my author pic is named "Zippy the Pinhead". Not that that's important, but I don't want to get on Zippy's bad side...
(If this comment was disrespectful, please report it.)

 
10/1/2005 6:41:21 PMCarles P.V.

Yes, but this is a clean and clear solution (*blocked* self-explanatory routine names) when code becomes so fragmented. No matter how many routines you end with. This way code is easier to follow. You always can examine each routine to know how is everything achieved. Main routine becomes then a *pseucode* routine which is more readable than a nested 'If block' one. Sometimes initial code is simple but quickly can become quite complex. Then the problem is when and how to decompose it (recode all) to turn it back again to a readable work... And this is not easy, especially when you try to preserve it all in a single code module.
(If this comment was disrespectful, please report it.)

 
10/1/2005 8:38:33 PMLaVolpe

Matt, depending on how many of my suggested enhancements and those of others that you attempt to build in, maybe consider using classes to handle the unique selection, highlighting, etc (a class for each key style). I would think it would be much easier to troubleshoot, modify, and add future functionality/styles. My $.02 worth.
(If this comment was disrespectful, please report it.)

 
10/1/2005 8:49:20 PMZhu JinYong

1.glad to see Unicode support.I have tested it.
2.allow duplicated items?
3.Keep scrolling,CPU is 100% usage.
(If this comment was disrespectful, please report it.)

 
10/1/2005 9:42:40 PMOption Explicit

OK I have made my first enhancement. Thanks to LaVolpe for the suggestion. Replaced the .PictureTiled property with a .PictureMode property that allows you to display background picture as normal, tiled, or stretch-to-fit the control. One of LaVolpe's suggestions down, 2000 to go... :-)
(If this comment was disrespectful, please report it.)

 
10/1/2005 9:46:45 PMOption Explicit

LaVolpe, haven't looked through your list thoroughly yet but I did notice your FileListBox suggestion. One of my future plans is a replacement for the common dialog control. It's made up of controls I have already done - single-line textbox, checkbox, buttons, now a listbox. MorphCDC... that would be a nifty piece of learning for me. So MLB *will* be enhanced for filename/icon display. Eventually.
(If this comment was disrespectful, please report it.)

 
10/2/2005 1:37:48 AMJim Jose

Matt, I wonder u thinks on the exact same way that I does :). Bcose, a custom common dialog is the primary aim for me too... And I am glad to say that I completed the 'DriveMode', 'DirectoryMode' and 'FileMode' for the new version of McListBox. Keep working with it. I wish u all succeess!
(If this comment was disrespectful, please report it.)

 
10/2/2005 5:45:26 AMLibor Blaheta

Thanks, you're right. I would like to see Unicode support. You never know who will need to display non-ASCII chars ;-).
(If this comment was disrespectful, please report it.)

 
10/2/2005 8:57:59 AMLight Templer

Hi Matthew, first of all: My ***** to this great control! Ownerdrawn, selfcontained, well structured and readable code, many comments, runs fine = 5 ;-) There is a lot of we can learn from your code. Be sure you 'll get COTM for this!
btw: Mousewheel works fine with W2K.
A few suggestions: * Design is fine for fancy private apps, but I don't want to show it to my chief ... ;-))) Maybe one or two more standard, leight weight themes can help. (e.g. the highlight design of the text when selected and the vertical scroller are looking bold. The scrollers highlight in gradient is too wide.
* Curved corners are fine on start, but overwritten when loading the list.
Once more: Thx for this gem!
Regards - LiTe
(If this comment was disrespectful, please report it.)

 
10/2/2005 9:10:58 AMOption Explicit

Hi LiTe. Thanks very much for the comment and vote. Regarding your comment "Design is fine for fancy private apps but I wouldn't want to show it to my chief", you inadvertently hit the nail on the head - this is meant for people desinging their own shareware type programs, etc. You're absolutely right, my controls would probably bother some in the business world because they're not "standard looking". As far as the corner rounding I believe I'm going to take it out, I just threw it in because I had those routines available. However I don't think rounded curves really "work" for this type of control. I'll look at the other issues you pointed out. Thanks again!
(If this comment was disrespectful, please report it.)

 
10/2/2005 1:17:05 PMLibor Blaheta

OK Unicode works (WinXP) :-)
(If this comment was disrespectful, please report it.)

 
10/3/2005 1:32:31 AMChad Gutowsky

Mass Coolness, great job. 5 for sure.
(If this comment was disrespectful, please report it.)

 
10/3/2005 2:09:22 PMHeriberto Mantilla Santamaria

Absolutly incredible, allow to give you a plaudit, though I make it only of virtual form. You waits soon for my restlessnesses though I don't believe find anyone.
(If this comment was disrespectful, please report it.)

 
10/3/2005 2:20:26 PMOption Explicit

Libor, thanks for letting me know about the Unicode. That's a relief. And thank you, Chad and Heriberto, for the kind words and votes.
(If this comment was disrespectful, please report it.)

 
10/3/2005 10:19:48 PMOption Explicit

Zhu: I have looked at the situation you described where cpu usage goes up to 100% during scrolling. It happens in the ProcessContinuousScroll and ProcessVThumbScroll routines, where there are event-interruptable while loops in effect. Since there is a DoEvents in each loop to allow for outside processing I'm not sure what I can do to alleviate cpu usage. However I'm certainly open to suggestions. Thanks for pointing it out to me.
(If this comment was disrespectful, please report it.)

 
10/4/2005 10:33:43 AMMike Douglas

Will be nice to see a full list of controls that support the same visual effects, single line textbox (needs multi-line capability), and listbox down...buttons, checkboxes, treeview, etc to go. :) 5* for the effort.
(If this comment was disrespectful, please report it.)

 
10/4/2005 10:49:26 AMOption Explicit

Hi Mike, thanks for the comment and vote. I'm gradually developing these controls as I need them for my own projects, plus I'm planning on trying to redo the UI's of my work systems if I can talk the powers that be into it. I already have the checkbox, option button, frame, and a command button... I haven't done a multiline addition to the textbox yet because I don't use it, at home or at work. So that's kinda low on my priority list. Thanks again.
(If this comment was disrespectful, please report it.)

 
10/4/2005 2:32:38 PMOption Explicit

An FYI: If you are loading a MorphListBox in a form's Load event, it won't display the list, just the background you have defined. However, if you load the listbox using the Form_Activate event, all works fine. Thought I'd save you the frustration I experienced figuring out why my lists were not displaying in a new form. :p

(If this comment was disrespectful, please report it.)

 
10/4/2005 2:34:56 PMOption Explicit

Also: Mike Douglas offered a tip to help with CPU 100% during scrolling, will try it out and repost if successful. Am also incorporating drag and drop, something I need and you all might like too. Stay tuned...
(If this comment was disrespectful, please report it.)

 
10/4/2005 3:45:37 PMOption Explicit

OK Mike Douglas's tip works great. Declare the Sleep API at the top of the control and add a "Sleep 25" after the DoEvent statement in the ProcessContinuousScroll and ProcessVThumbScroll routines. I'll repost with the fix when I get drag and drop going. Thanks very much Mike.
(If this comment was disrespectful, please report it.)

 
10/4/2005 5:28:36 PMMike Douglas

Sure thing. Any chance of an Oklahome "Okie" themed version of these controls? jk :)
(If this comment was disrespectful, please report it.)

 
10/5/2005 9:05:27 AMOption Explicit

Ok, have an update... Drag-and-drop is implemented, there's an example in the demo project. Implemented Mike's 100% cpu usage solution and a property to allow you to choose between 2 different checkmarks in Extended selection mode. Enjoy.
(If this comment was disrespectful, please report it.)

 
10/5/2005 1:22:00 PMRiccardo Cohen

Woow Matt, this is good! Any plans to add the function with icons (XP-alpha)?
Btw. 5 globes!
(If this comment was disrespectful, please report it.)

 
10/5/2005 3:00:52 PMHeriberto Mantilla Santamaria

Hi Matt, only suggestion,

---------------------------------------
change the value of

hPN = CreatePen(0, 2, ArrowColor) to
hPN = CreatePen(0, 1, ArrowColor)

Sub DrawScrollButtonArrow

---------------------------------------change the value of

DrawRectangle m_BorderWidth + 3, YCoordStart, m_BorderWidth + 18, YCoordStart + 14, m_CheckBoxColor to
DrawRectangle m_BorderWidth + 4, YCoordStart, m_BorderWidth + 18, YCoordStart + 14, m_CheckBoxColor


Sub DisplayCheckBox

---------------------------------------change the value of

y1 = Index + 2 to
y1 = Index + 1


Sub DisplayCheckMark
---------------------------------------
With this draws a better arrow's.
(If this comment was disrespectful, please report it.)

 
10/5/2005 4:22:53 PMOption Explicit

Heriberto, the scroll bar direction arrows look MUCH better after using your suggestion. And I also moved the checkbox one pixel to the right like you suggested. However, the third suggestion I did not. It makes the checkmark display off-balance. I have noticed some subtle display differences between LCD flat-panel and CRT displays while testing this control. Make a change that makes it pixel-perfect on a flat-panel, and you see an unacceptable result for a CRT. I don't know why that is (graphics card maybe). So I've had to compromise. Thanks for taking the time to look, and for making this submission better! I'll repost soon.
(If this comment was disrespectful, please report it.)

 
10/5/2005 4:26:21 PMOption Explicit

Hi Riccardo, thanks for the comment and vote. Umm, I won't be adding icon display capability to this. If that's something you need, check Jim Jose's great 'McListBox' submission. I *will* be making a file list box out of this control eventually, meaning I'll be displaying file icons next to the filenames. But that will be a separate control. Thanks again.
(If this comment was disrespectful, please report it.)

 
10/5/2005 8:10:54 PMJeff Mayes

If Style=Checked and MultiSelect=None, Multiselection is still allowed.
(If this comment was disrespectful, please report it.)

 
10/5/2005 8:59:27 PMHeriberto Mantilla Santamaria

I wait a new update...
(If this comment was disrespectful, please report it.)

 
10/5/2005 9:26:21 PMOption Explicit

Heriberto, the way all submissions are approved manually by moderators now, I wait until I have a few modifications in place before I make an upload. With MorphTextBox I could resubmit 50 times a day small changes, and not worry that my submission was going to disappear for hours at a time. Now, I have to not submit so often. I've got your two suggestions in, and am now writing code that changes the color of the clicked portion of the scrollbar track (just like a vb listbox behaves). Patience my friend! :-)
(If this comment was disrespectful, please report it.)

 
10/5/2005 9:37:15 PMOption Explicit

Jeff, the way I have this designed, Style=CheckBox always takes precedence over any of the MultiSelect modes. In a regular VB listbox, you have to have MultiSelect set to None in order to set Style to Checked, otherwise you get an error messagebox (even though you can still select multiple items in CheckBox mode). That didn't make much sense to me, so I just decided to have CheckBox style take precedence, that way it doesn't matter what MultiSelect mode you're in. Design choice, not a bug.
(If this comment was disrespectful, please report it.)

 
10/5/2005 9:48:50 PMOption Explicit

The other way to say it is this: In a regular VB listbox, Style=CheckBox has nothing to do with the MultiSelect modes (it's its own mode with its own behavioral characteristics, independent of MultiSelect). It's just that for some strange reason Microsoft makes you set MultiSelect to None before you can set Style to CheckBox. I don't follow that dumb requirement, that's all.
(If this comment was disrespectful, please report it.)

 
10/5/2005 9:58:35 PMOption Explicit

Now that I think about it, there may actually be a reason Microsoft has this strange requirement. Style=CheckBox and MultiSelect=None have 2 things in common - in both modes, 1) the focused item and the highlighted item are the same, and 2) there can be only one highlighted item at a time. Maybe Microsoft wanted to use part of its MultiSelect=None behavioral logic in Style=CheckBox mode, so they force the user to set MultiSelect=None before Style=CheckBox. That way they didn't have to write all the behavioral logic separately for Style=CheckBox, they can just borrow some from MultiSelect=None.
(If this comment was disrespectful, please report it.)

 
10/6/2005 10:05:01 AMOption Explicit

Ok, a minor update... in a regular VB textbox, when you click on the track part of the scrollbar above or below the scroller thumb, that part of the track changes color. That has been implemented, with programmer control over colors as usual. Also have incorporated some of Heriberto's suggested tweaks, thanks again Heriberto.
(If this comment was disrespectful, please report it.)

 
10/6/2005 11:09:21 AMJeff Mayes

OK, I can understand the checkbox being priority. Apparently my last comment, prior to 1.03 never got posted. Thanks, moderator! The comment was simply that the sorting is all string based. If I enter a list of numbers, such as 15, 5, 3 in a sorted list box, the result is 15, 3, 5 rather than 3, 5, 15 (numeric). Any work around or plans to check if the sort should be numeric?
(If this comment was disrespectful, please report it.)

 
10/6/2005 11:56:46 AMOption Explicit

Well a listbox is a string-based after all, and I really have no plans to make it anything else. I just want this to emulate a regular listbox (but look better), so that's not in the cards.
(If this comment was disrespectful, please report it.)

 
10/6/2005 4:14:12 PMHeriberto Mantilla Santamaria

Thanks for the info and I understand you when you say the moderator of PSC and the VB Listbox, calm you go slowly on my behalf there isn't hurry.

Thank you to have present my suggestions.
(If this comment was disrespectful, please report it.)

 
10/6/2005 5:31:30 PMOption Explicit

:-) Who knows, Heriberto? PSC is a democracy, and votes are given for whatever reasons the giver wants. Sure it's nice to know why, but as long as the votes are honestly given (as a result of a fair judgment of the quality of the submission), and aren't just based on some missing feature that they think should be in the program but isn't, or some other hidden personal agenda, any vote is valid (even a 1). No one is required to vote a 5, as you know.
(If this comment was disrespectful, please report it.)

 
10/6/2005 5:35:01 PMOption Explicit

I've had people give 4 globes and promise to make it a 5 if I add weird features they want or something. I'm not a dog, and therefore won't sit up on my hind legs and beg for the extra globe like it was a doggy treat. I won't be played like that. COTM contests are nice, but having some self-respect is much more important.
(If this comment was disrespectful, please report it.)

 
10/6/2005 5:49:59 PMOption Explicit

Slightly tweaked the code; resubmitted. Thumb scroller should work more fluidly and smoothly on slower systems (I was recalculating the thumb gradient every time the scroll thumb was moved or resized. Not smart.).

(If this comment was disrespectful, please report it.)

 
10/7/2005 7:01:50 AMHeriberto Mantilla Santamaria

If Matt, nobody discusses this but it would be good to know where is the flaw to improve, considers the existence of the globes for that reason.
(If this comment was disrespectful, please report it.)

 
10/7/2005 10:58:01 AMRichard Mewett

Nice updates. This deserves more Votes!
(If this comment was disrespectful, please report it.)

 
10/7/2005 11:09:50 AMJeff Mayes

I explained why I gave 4 in my lost comment. Based on the work alone, I must admit that you deserve 5, but to me there still are some things (like the sorting) which might be improved. However, as I said, for the great work and clean coding you probably deserve a 5, so I have changed my vote.
(If this comment was disrespectful, please report it.)

 
10/7/2005 11:17:28 AMOption Explicit

Jeff I wasn't referring to you in that comment I made to Heriberto (about people not giving an honest vote because there's a bell and whistle they want that's not in there). I was thinking of another individual actually. As I said an honest vote is an honest vote, whether it is a 1 or a 5. So thank you but don't feel obligated to give a 5 vote when you feel a 4 is more appropriate. Although I admittedly posted this on the 1st as a blatant contest entry, whatever happens happens.
(If this comment was disrespectful, please report it.)

 
10/7/2005 11:26:17 AMOption Explicit

Now, about the feature Jeff wants that caused all this hubbub about 1 lousy globe in the first place... :-) He wants the ability to optionally sort the list treating the list as numeric instead of as strings. For example, 5, 10, 30 sorts to 10,30,5 if treated as string. Is this something other people would like to see? If there is some feedback indicating yes I'll add it. I just don't want to slow down the sort unnecessarily. If there is enough call for it, though, it's simple enough to add.
(If this comment was disrespectful, please report it.)

 
10/7/2005 11:33:27 AMOption Explicit

Hi Richard, thanks for the comment. According to the contest standings I'm up against two powerful forces: God and Jim Jose. I don't think I can compete :-)
(If this comment was disrespectful, please report it.)

 
10/7/2005 3:46:47 PMOption Explicit

Never mind, I just went ahead and added a .SortAsNumeric property. If your listbox contains all numbers, and you wish to keep them in sorted order, just make sure both the .Sorted and .SortAsNumeric properties are both set to True.
(If this comment was disrespectful, please report it.)

 
10/7/2005 7:01:52 PMOption Explicit

Ok, remember how I say here and in the control that if you want to load a MorphListBox automatically on form startup to do it in the Activate event instead of the Load event because the list doesn't display for some reason in Load? Well I forgot that Activate is not just a form startup event but triggers every time focus returns to the form. So until I can figure out why the list doesn't display in Load, just use a boolean to flag that you've already loaded the listbox so that when you switch between forms the listbox doesn't load every time the form regains the focus. Sheesh.
(If this comment was disrespectful, please report it.)

 
10/8/2005 12:18:27 AMOption Explicit

Ok the bug is fixed... if you need to fill a listbox in Form_load that's OK now. No need to use Form_Activate anymore. Sorry about that, despite all the controls I've written there are still new things to learn each time...
(If this comment was disrespectful, please report it.)

 
10/8/2005 3:44:29 PMJeff Mayes

Thank you for the update, it is much appreciated, but I upgraded to a 5 vote before you decided to. I don't feel obligated. As I mentioned, the work alone deserved a 5.
(If this comment was disrespectful, please report it.)

 
10/8/2005 9:46:52 PMOption Explicit

Am tweaking the control for speed performance and adjusting a (tiny) graphics glitch, will resubmit soon. Have also been running some timing tests... When used as an external .OCX, Morphlistbox is loading 10000 items (maintaining sorted order) in .35 seconds; regular VB textbox .74 seconds on an XP Pro 2.4 GHz system. Like I said, it's faster than a regular listbox on many systems. :-)

(If this comment was disrespectful, please report it.)

 
10/9/2005 6:33:44 PMOption Explicit

Resubmitted with some speed and graphics tweaks. Scroll thumb height was getting unnecessarily recalculated and my formula for determining how much of the scrollbar track should be highlighted when track is clicked above or below thumb was off slightly.
(If this comment was disrespectful, please report it.)

 
10/10/2005 5:45:43 PMDean Camera

Arrgghh! As always your blinding submissions humble me. Come on people, vote!

- Dean
(If this comment was disrespectful, please report it.)

 
10/10/2005 9:27:10 PMJeff Mayes

Quick suggestion - setting the listindex to an item which is out of view does not move the scrollbar to bring the item into view. Is there a workaround?
(If this comment was disrespectful, please report it.)

 
10/10/2005 9:53:13 PMOption Explicit

I assume you mean changing the .ListIndex property through code. Just off the top of my head I would say that would probably not be a big deal. I wouldn't automatically do it just because the .ListIndex changed (i.e. in the Property Let). Rather, what you're asking falls into the category of something I was considering anyway - a new method called .DisplayFrom or something similar. "MorphListBox1.DisplayFrom MorphListBox1.ListIndex" would change the display to show all items from .ListIndex to the end of the displayable viewing range. Is that something like what you had in mind?
(If this comment was disrespectful, please report it.)

 
10/10/2005 9:55:16 PMOption Explicit

Thanks for the vote Dean, didn't mean to blind you. I actually thought I had toned the screenshot down a little so Anders Lyman wouldn't go crazy... guess I didn't quite get there.
(If this comment was disrespectful, please report it.)

 
10/11/2005 5:34:42 AMDean Camera

Well, it's certainly better - but I still wish I was colourblind :D. Also, what's the story with Zippy the Pinhead?? - Dean
(If this comment was disrespectful, please report it.)

 
10/11/2005 11:11:12 AMJeff Mayes

Yes, I did mean changing from code, and the .DisplayFrom sounds perfect. Just out of curiousity, what would happen id .DisplayFrom is set to .ListCount-1?

(If this comment was disrespectful, please report it.)

 
10/11/2005 12:01:42 PMOption Explicit

Jeff, I wrote the new method last night, I'll submit shortly. In answer to your question, if the item passed as a parameter in the .DisplayFrom falls anywhere in the last displayable page (m_ListCount - MaxDisplayItems + 1) the entire last page is displayed so there's no 'white space' under the last item. So in that case the passed parameter wouldn't be necessarily at the top of the displayed portion of the list; it would be displayed wherever it happens to be in the last page.
(If this comment was disrespectful, please report it.)

 
10/11/2005 12:06:09 PMOption Explicit

Dean, Zippy is just a new cartoon author pic; Seymour Skinner was getting kind of old. That's why my user name is not "Matthew R. Usner" anymore, but "Option Explicit". I figured it was appropriate because of the explicit comments I leave... Plus why not have a nickname? Many people have cool nicknames ("Light Templer", "LaVolpe") and some are just so ridiculous you wonder how the heck the person came up with it ("Ian Ippolito"). So why not me? Btw j/k Ian...
(If this comment was disrespectful, please report it.)

 
10/11/2005 12:22:13 PMOption Explicit

OK, the update with the .DisplayFrom method is now posted.
(If this comment was disrespectful, please report it.)

 
10/11/2005 3:57:27 PMHeriberto Mantilla Santamaria

Hi Matt.

I have two suggestions, it would be brilliant to add a print sub, something how .print that it takes out the whole content of the list and enabled/disabled items of the list.
(If this comment was disrespectful, please report it.)

 
10/11/2005 5:40:44 PMOption Explicit

Hi Heriberto. If you mean making a printout from the listbox, I think that type of coding would be best left to the application that uses the listbox (in other words, put printing code in the form module or a .bas module), not the listbox itself. I may have misunderstood you though.
(If this comment was disrespectful, please report it.)

 
10/11/2005 7:55:05 PMHeriberto Mantilla Santamaria

Yes, you understood it well, but what I look for is to create a quicker procedure that the traditional one.
(If this comment was disrespectful, please report it.)

 
10/11/2005 10:22:45 PMHeriberto Mantilla Santamaria

Nice author pic.
(If this comment was disrespectful, please report it.)

 
10/12/2005 10:29:09 AMOption Explicit

Pretty funny eh? Anyway I really don't want to put a print method in this - I really don't see a great benefit and this control is big enough as it is. Thanks for the suggestion though, keep 'em coming!
(If this comment was disrespectful, please report it.)

 
10/12/2005 12:47:58 PMHeriberto Mantilla Santamaria

If, analyzing it more deeply is right.
(If this comment was disrespectful, please report it.)

 
10/12/2005 8:47:57 PMGeorge Inacio

I found your control interesting, good-looking and very useful.
As you said better be on OCX.
I have a problem, I don’t know how to do it.
Can you please make some code so we can compile it in a OCX.
Keep up the good work and thanks for sharing.
(If this comment was disrespectful, please report it.)

 
10/12/2005 9:44:09 PMOption Explicit

Hi George, thanks very much for the nice words and the vote. As far as making the control an .OCX, that's very easy... It's a good idea for me to write up a quick "Readme.txt" on how to do it. I'll email you such a readme tomorrow and will include it in future updates of this controls. Basically it involves starting VB and opening a new ActiveX project. Import that control and in the file menu it says Make MorphListBox.OCX. That makes the OCX (I'm not near a VB machine now but I think that's right.) Regardless, I will email you. Thanks again.
(If this comment was disrespectful, please report it.)

 
10/13/2005 3:53:05 PMredbird77

Very cool and coloful ;) 5 globes! A little tweak though... When you select an item the selection color "peeks" out past the left edge of the focus rectangle by one pixel. I solved it by shortening the selection color rect. You could widen the focus rect too, though I like the look of the gap between the left edge of the control and the start of the focus rectangle.
(If this comment was disrespectful, please report it.)

 
10/13/2005 4:05:08 PMOption Explicit

Thanks Redbird77. I saw that the other day but forgot all about it, thanks. It will be fixed, but for now all the millions of people that undoubtedly use this control :\ can make the fix themselves just like Redbird describes above. Thanks for the comment and the vote!
(If this comment was disrespectful, please report it.)

 
10/13/2005 5:42:08 PMOption Explicit

OK, reposted with Redbird77's suggested visual tweaks. Thanks again Redbird.
(If this comment was disrespectful, please report it.)

 
10/14/2005 11:27:22 AMOption Explicit

Redbird77 was nice enought to spend some time examining this project and came up with a fix to a glitch in the background gradient draw routine that is very visible when the border is quite wide (say 15 pixels). Redbird also rewrote the DisplayListBoxItem routine, possibly the most frequently-called procedure, and made it half the size and much more efficient. Thank you very much Redbird. It takes a talent I don't possess to read "OPC" (Other People's Code) and make it better. If you worked for Microsoft maybe their OS's wouldn't be so bloated!
(If this comment was disrespectful, please report it.)

 
10/18/2005 4:08:26 AMCris Friolo

Very nice control, It will much more interesting if this will be a LISTVIEW - icons, multicolumn, columnheading, etc. 5 votes from me
(If this comment was disrespectful, please report it.)

 
10/18/2005 11:16:09 AMOption Explicit

Thanks Cris. I'm not sure if I'll be turning this into a ListView-type control. If I do it won't be until I get other controls done first, because I don't have any projects (home or work) that use ListView controls, and I have to do controls I commonly use first. However, you're correct - it would be a nice and logical extension of this control. Thanks again.
(If this comment was disrespectful, please report it.)

 
10/28/2005 12:45:12 AMLaVolpe

Jeez, what did you do that cat? Did it sit on zippy? Matt, another fine control; I think others will enjoy your latest creation when you are ready to post that one too. Hope God doesn't strike me as my vote will put you over his post :) P.S. Don't know how you continue to do it; I kinda lost the taste for creating custom drawn controls awhile back. But I guess every tough project has its own rewards, huh?
(If this comment was disrespectful, please report it.)

 
10/28/2005 9:52:56 AMOption Explicit

What can I say? I like controls. Don't know why, they just kinda grabbed my attention. Like you say, for me just getting them to work is the reward. At least my next project isn't a replica of an existing vb control... Thanks for the vote.
(If this comment was disrespectful, please report it.)

 
10/31/2005 4:38:30 PMMark T.

Same brilliant stuff - Ho hum!
5 lobes for you.
(If this comment was disrespectful, please report it.)

 
10/31/2005 5:59:05 PMOption Explicit

Lobes? :-) Well, I guess I need all the lobes I can get considering my recent lobotomy. Thanks for the vote!
(If this comment was disrespectful, please report it.)

 
11/13/2005 3:42:01 PMRichard Mewett

Congrats on another COTM. Glad that this got the recognition it deserved after a slow start ;)
(If this comment was disrespectful, please report it.)

 
11/13/2005 6:03:18 PMOption Explicit

Surprises the heck out of me! I totally didn't expect it. Now that I'm a multiple COTM winner I'm REALLY gonna be insufferable... as if I wasn't before ;-) Thanks Richard (and thanks to everyone who voted and left feedback).
(If this comment was disrespectful, please report it.)

 
11/13/2005 6:04:02 PMOption Explicit

LaVolpe, now you know why the cat in my author pic looks so shocked.
(If this comment was disrespectful, please report it.)

 
11/14/2005 7:29:54 AMJim Jose

Matt + UC = CTOM ; Congrats... you did it again!! Thanks for the great work!!
(If this comment was disrespectful, please report it.)

 
11/30/2005 2:03:07 PMSteven Atkiss

LMAO, hey Matt, excellent control. Have to say though most of these comments are from you... I'm nearly wetting myself with laughter. 5 from me though dude.
(If this comment was disrespectful, please report it.)

 
11/30/2005 4:03:06 PMOption Explicit

Yes I am a talky s.o.b. aren't I? :) I figure if people take the time to leave a remark, I should have the decency to reply. Ironically enough, I'm a pretty quiet person in "real life". Thanks for the comment and vote.
(If this comment was disrespectful, please report it.)

 
12/13/2005 8:20:43 AMOption Explicit

Thanks for the vote Aaron. Even though the contest is over, I always appreciate a vote or comments from people who download this. Lets me know people are still trying it out.
(If this comment was disrespectful, please report it.)

 
1/25/2006 7:34:59 AMOption Explicit

First update in four months... Light Templer noticed the corner curvature was not working properly; that has been fixed. Have added a complete disabled graphics propertyset that allows you to set the look of the control when disabled exactly the way you want (something I overlooked originally). Have fun.
(If this comment was disrespectful, please report it.)

 
1/25/2006 11:32:43 AMJeff Mayes

Hello again! As I said before, great control. I must admit, though, that I am not using it in my current project. Why? I need columns (set tabstops through hwnd).... Sorry. I wish I had the skill to make this though. Great job.
(If this comment was disrespectful, please report it.)

 
1/25/2006 2:05:13 PMOption Explicit

Hi Jeff. Yeah, I know, in order for this to be of more universal appeal multiple columns would be nice. Hey I'm lucky I had the time to make the corrections I did! Maybe someday. That and multiline MorphTextBox seem to be on the wish list for people. Thanks for the comment.
(If this comment was disrespectful, please report it.)

 
1/25/2006 3:20:01 PMJorgen Levesen

Hi
I am trying to evaluate your seamlingly superb control but keep getting the error:
"Subscript out of range" in the Sub:
Private Sub SetSelectedArrayRange(ByVal FirstValue As Long, ByVal LastValue As Long, ByVal bSelectedStatus As Boolean) pointing to the "FillMemory" procedure.
Any idea what is causing this ?
Kind regards Jorgen
(If this comment was disrespectful, please report it.)

 
1/25/2006 4:37:58 PM[])utch[]v[]aster

Now we just need a MorphTextbox (Multi-line), MorphComboBox, MorphScrollbars, and Morph Buttons then we'll be all set
(If this comment was disrespectful, please report it.)

 
1/25/2006 4:38:16 PM[])utch[]v[]aster

Oh, BTW 5 MorphBalls
(If this comment was disrespectful, please report it.)

 
1/25/2006 7:05:10 PMOption Explicit

Jorgen, replied offline to find out. Out of 1000's of downloads between here and other sites nobody has reported that error; kinda praying it's an innocent mistake on your part :) Thanks for the vote also. DutchMaster, thanks for the MorphComment and MorphVote; am working on some of those MorphIdeas as we MorphSpeak :)
(If this comment was disrespectful, please report it.)

 
1/25/2006 9:05:22 PMbob8

great!
(If this comment was disrespectful, please report it.)

 
1/25/2006 9:47:50 PMOption Explicit

Jorgen I may have your answer... in the UserControl_Click routine change the If statement to read "If m_Enabled And Not RightClickFlag And MouseOverIndex(MouseY) <> -1 Then". A listbox should not return a click event if the mouse cursor is not in a populated part of the listbox. Your using the .ItemData property array was the key to finding it, thanks!. I'd reupload it but with the new display rules it would go to the top of the submissions again and that seems unfair, so I'll wait till I have a few mods to repost. I don't like this new method of displaying submissions. Too much potential for abuse.
(If this comment was disrespectful, please report it.)

 
1/26/2006 7:12:49 AMTerry L

Ok first of all you get the 5 marbles on the control and hard work. I have one problem useing the control on a project I'm working on. Im useing a third party Image control to view tiff files and useing the Private Sub List1_Click()event shows the image just fine, but useing your control with the Private Sub MorphListBox1_Click()I receive a run time error (13) that says Type Mismatch. Any Ideas because it would sure look nice in the project I'm working on. Thanks and keep up the great work.
(If this comment was disrespectful, please report it.)

 
1/26/2006 8:08:31 AMRichard Mewett

> "Now that I'm a multiple COTM winner I'm REALLY gonna be insufferable"

Good to see that your celebrity status has not stopped you updating this :)
(If this comment was disrespectful, please report it.)

 
1/26/2006 1:31:09 PMOption Explicit

Terry, got your example, I think you may be using incorrect syntax... MorphListBox tries hard to emulate regular VB listbox functionality but it's not quite a drop-in replacement. Check your inbox. Richard, you know me, always working on the next control. However I needed to get that disabled functionality in and that bug reported by Light Templer has always been in the back of my mind... Hope I'm not too insufferable for ya :)
(If this comment was disrespectful, please report it.)

 
1/26/2006 2:10:49 PMOption Explicit

Ok, it WAS an incorrect syntax problem on Terry's part (whew!) and Jorgen's problem was worked out similarly. Just remember in the UserControl_Click routine change the If statement to read "If m_Enabled And Not RightClickFlag And MouseOverIndex(MouseY) <> -1 Then" until I reupload it. Cool!
(If this comment was disrespectful, please report it.)

 
1/26/2006 3:20:26 PMTerry L

Works like a charm!:)
(If this comment was disrespectful, please report it.)

 
1/27/2006 7:19:10 AMOption Explicit

Sorry about the repost, but I had to fix a semi-bug found by a couple users. I really hate it that updates are now moved to the top of the "New Submissions" list; it's unfair to people who actually submit new projects. Nevertheless, tweaked the UserControl_Click event, added default values for the new disabled propertyset and added .TopIndex property that returns the index of the first-displayed list item.
(If this comment was disrespectful, please report it.)

 
1/27/2006 4:02:20 PMHeriberto Mantilla Santamaria

Yes Matt, PSC should put the update in another side.
(If this comment was disrespectful, please report it.)

 
1/27/2006 5:43:51 PMOption Explicit

I agree. People can abuse this all kinds of ways. To grab more votes in a contest (by making insignificant changes and resubmitting), just pestering people. People who submit honest new submissions are pushed off the front pages. And people who have to make several valid fixes to their code to get it right (as with my controls sometimes) will get accused of being selfish front-page hogs. And the moderators seem to have a difficult enough time keeping up, I can't imagine they want to babysit this. I emailed Ian with my opinions, he said thanks and appreciates all feedback regarding this and that this is kind of a test. So feel free to email by clicking on the "For feedback not related to this particular code, please click here." link on every submission.

(If this comment was disrespectful, please report it.)

 
1/27/2006 5:47:41 PMOption Explicit

I suggest that if PSC wants this feature it is valid. However, we should have the option of viewing either *only* new submissions (the old way) or both new and updated submissions (the current way). I am no website programmer but that is elementary database manipulation and has to be an easy task. OK rant over :)
(If this comment was disrespectful, please report it.)

 
1/29/2006 11:36:28 AMOption Explicit

Well whaddaya know... there's now a "ignore updates" checkbox when viewing the new submissions list... I guess whining works sometimes :)
(If this comment was disrespectful, please report it.)

 
2/3/2006 10:50:12 AMkerplunk_boy

Holly molly wackamolly!!! This is awesome!!! 5 globes dude!!!
(If this comment was disrespectful, please report it.)

 
2/3/2006 10:56:16 AMkerplunk_boy

Hey! What about a ComboBox?
(If this comment was disrespectful, please report it.)

 
2/3/2006 1:12:09 PMOption Explicit

Thanks for the comment, K.B., one can never get too many wackamollies! As far as a combo box, that is coming, although I would be hard pressed to top Richard Mewett's ComboView at txtCodeId=61438. However, I already have all the components: MorphTextBox, MorphListBox and MorphButton. So one day I will definitely sit down and try to merge them into a MorphComboBox. Great, I can just see it now... PSC's first 12,000 line usercontrol :\
(If this comment was disrespectful, please report it.)

 
2/18/2006 5:18:16 AMOliX

It would be great if we would be able to set different color for each item. Anyway great control, clean code...
(If this comment was disrespectful, please report it.)

 
2/18/2006 10:17:57 AMOption Explicit

Hi OliX. That would not be a difficult addition, I'll look into it... First I'm in the process of implementing icon display next to items, which was a suggestion from a few other people. I'll add your suggestion to the list. Thanks for the feedback.
(If this comment was disrespectful, please report it.)

 
2/25/2006 10:34:22 PMOption Explicit

OK, have listitem icon display capability in due to several requests. Just set the .ShowItemImages property to true, and in your form code call the .AddImage method to have the listbox load images. It's pretty easy; the demo project explains it all. See the description for the .ItemImageSize property in the property window to understand its usage. Have fun, hope it helps.
(If this comment was disrespectful, please report it.)

 
2/26/2006 1:49:29 PMOption Explicit

Have added a separate demo form showing listitem icon display usage, and twaeked the .ShowItemImages property to be callable from form code.
(If this comment was disrespectful, please report it.)

 
2/26/2006 5:54:21 PMOption Explicit

OK a couple of minor glitches relating to icon display are fixed (hopefully).
(If this comment was disrespectful, please report it.)

 
2/26/2006 9:08:13 PMHeriberto Mantilla Santamaria

Hi Matt

Thx for my nice icon and congratulations for your excellent work.

I see this Listbox more great with the advanced of the time.

Again thx for this excellent UC, I'll prove it and comment to you.

(If this comment was disrespectful, please report it.)

 
2/27/2006 7:55:39 AMOption Explicit

No problem Heriberto. Glad you like your icon :)
(If this comment was disrespectful, please report it.)

 
2/27/2006 8:37:10 AMRichard Mewett

Excellent update. One question - where did you find my photo? ;)
(If this comment was disrespectful, please report it.)

 
2/27/2006 11:23:13 AMOption Explicit

Thanks Beavis, erm, Richard... Your wife emailed me this photo of you at my request :)
(If this comment was disrespectful, please report it.)

 
2/27/2006 5:34:57 PMLaVolpe

Been a busy beaver, huh? Is my icon "...because he (LaVolpe) lives in the damp caverns underneath a cathedral..."? :)
(If this comment was disrespectful, please report it.)

 
2/28/2006 8:00:11 AMOption Explicit

Absolutely correct, my hunchbacked bellringing friend... I googled Quasimodo.ico in Google Images but nada, so I tried Igor.ico and voila! If it makes you feel better at least I made myself Butthead, which I think was appropriate. :)
(If this comment was disrespectful, please report it.)

 
2/28/2006 10:45:06 AMHeriberto Mantilla Santamaria

Hi Matt

You can write in spanish, else plz tell me what meaning nada for you, coz in my language (Spanish) Nada = Nothing.

I wait you can write in spanish, xD.
(If this comment was disrespectful, please report it.)

 
2/28/2006 12:00:14 PMOption Explicit

Heriberto, hablo espanol muy poquito y muy terible... mi espanol esta su ingles :D

"Nada" means "Nothing" in English too!
(If this comment was disrespectful, please report it.)

 
2/28/2006 2:52:54 PMHeriberto Mantilla Santamaria

Yeah my English is terrible too.

But I understand your spanish, you understand my bad english.
(If this comment was disrespectful, please report it.)

 
3/4/2006 3:07:56 AMDonald A. Kronos, Ph.D.

Actually, "nada" isn't an English word at all, but English is good at allowing words from other languages to be used... such as "nada" (from Spanish and Portuguese) and "voilà" (from French) for example... although often with slight changes in spelling or pronunciation, especially when the original form is hard to pronounce because of a strong English accent (American, British, etc.) or difficult to type on a keyboard designed for English (such as a standard 101 key American QWERTY style keyboard, or worse yet one like on the Toshiba notebook computer I'm using.) Sorry... getting off topic. Nice listbox control. :)
(If this comment was disrespectful, please report it.)

 
3/4/2006 9:39:08 AMOption Explicit

Funny how the course of conversation can meander :)... Thanks for the comment and vote Donald!
(If this comment was disrespectful, please report it.)

 
3/12/2006 9:37:05 PMOption Explicit

If you want the latest version of this control it can be found in my MorphBorder submission. It has .hDC, .AutoRedraw, .ScaleMode, .ScaleWidth, and .ScaleHeight properties in it now. I haven't updated it here (yet) because it seemed a bit of a trivial reason to push this to the top of the current submissions list. Later, I'll update this though.
(If this comment was disrespectful, please report it.)

 
3/14/2006 1:10:06 PMDardan

Great Code, but i created a search Sub to search an item in the list box, but if this listbox has many items that the scrollbar is present, it finds and selects the item but it doesnt scroll the index to the top. If you have a solution please let me know i would appreciate it.
(If this comment was disrespectful, please report it.)

 
3/14/2006 3:10:13 PMOption Explicit

Hi Dardan. Thanks for the feedback and vote. There is a method called DisplayFrom in the control, that when supplied a listitem index, displays the list from that point down. So when you determine the index of the item you searched for (let's call the index variable "FoundIdx"), the syntax is:

MorphListBox1.Display FoundIdx

Now the list displays with the item you were looking for at the top of the displayed items. Hope that helps and thanks again.
(If this comment was disrespectful, please report it.)

 
3/14/2006 3:17:05 PMOption Explicit

^Correction:

MorphListBox1.DisplayFrom FoundIdx

Duh.
(If this comment was disrespectful, please report it.)

 
4/19/2006 1:09:58 AMkk

great. but don't support right-to-left alignment. please add to the nice contros.
(If this comment was disrespectful, please report it.)

 
4/19/2006 7:42:14 AMOption Explicit

Hi kk, thanks for the comment. I have never done the right-to-left so I don't know what's involved. I can't promise anything, as I am very busy with work these days. I *do* promise to take a look for you. Thanks again.
(If this comment was disrespectful, please report it.)

 
5/12/2006 6:23:00 PMOption Explicit

After the umpteenth email inquiring how to programmatically access the currently selected listitem [Answer: MorphListBox1.List(MorphListBox1.ListIndex)], I caved and added a "quickie" .Text property that returns the same thing.
(If this comment was disrespectful, please report it.)

 
5/18/2006 8:46:26 PMPaul Bahlawan

Most excellent. I can't imagine ever using a regular listbox ever again!
(If this comment was disrespectful, please report it.)

 
5/20/2006 8:38:56 PMOption Explicit

Thanks Paul! Still have requests for features, will update periodically.
(If this comment was disrespectful, please report it.)

 
5/27/2006 3:12:18 PMOption Explicit

About 70% done with .RightToLeft capability... an interesting (by that, I mean "not fun") change... but it's going well and should be posted in a few days.
(If this comment was disrespectful, please report it.)

 
5/29/2006 7:37:49 AMOption Explicit

... or maybe in two days! Right-to-left functionality is in and now posted. For those who don't know (as I didn't), many VB controls have a .RightToLeft property that gives them a natural feel for those languages that are written from right to left. Form5 in the demo shows this attribute. I would appreciate feedback from members whose written languages are right to left. Did I do this adequately? I also added circular gradient capability.
(If this comment was disrespectful, please report it.)

 
5/29/2006 8:00:51 AMOption Explicit

Oh by the way thanks to 'kk' for the suggestion.
(If this comment was disrespectful, please report it.)

 
5/29/2006 3:22:44 PMRichard Mewett

A fine control just got even better. This is an extremely robust & well behaved control. Its also an excellent example of how to construct a complex project by logically breaking down code into manageable "chunks". :)
(If this comment was disrespectful, please report it.)

 
5/29/2006 3:49:47 PMOption Explicit

Thanks Richard. This is by far my favorite project - even though it is a huge beast - for the reason you described... I broke it down correctly and can pretty much do anything to it as a result. .RightToLeft was a LOT of mods though - in an ownerdrawn listbox it's absolutely critical to know exactly where the mouse pointer is at all times. Since the list, trackbar, thumb, buttons, icons, and checkboxes can go two ways now, making all the mods was kind of a bear. Hope someone can actually use this .RightToLeft; if I get enough feedback I may incorporate it into my other controls.
(If this comment was disrespectful, please report it.)

 
6/14/2006 7:36:45 AMOption Explicit

Gee, "kk", I'm so glad I spent 10 hours incorporating .RightToLeft into this control and emailing you to let you know it was ready... thanks for the ZERO feedback to let me know if it was OK for you. Grrrr...
(If this comment was disrespectful, please report it.)

 
10/21/2006 10:53:17 PMxpert

Excellent control... 5 globes
I think I found a bug or misbehaviour of the control: being in the IDE, when the control's Picture is set or changed or when the PictureMode property is changed, the control is not updated (the picture is not automatically shown or changed in the IDE).
Can you please fix that? That didn't happen in version 1.06
(If this comment was disrespectful, please report it.)

 
10/22/2006 9:47:53 AMOption Explicit

Hi xpert, thanks for the feedback and vote (and the votes on MorphDisplay and MorphTextBox too!). This should be simple enough to correct and as soon as I take care of some family issues (as I outlined in my email to you) I will fix/repost and notify you. Thanks again.
(If this comment was disrespectful, please report it.)

 
10/23/2006 9:14:36 PMOption Explicit

OK the two minor issues found by xpert have (hopefully) been resolved and project has been resubmitted. Thanks xpert.
(If this comment was disrespectful, please report it.)

 
10/24/2006 7:46:38 PMOption Explicit

If anyone has any ideas on how I can make this control better, by all means leave a comment. I have always intended this to be the best listbox control on PSC!
(If this comment was disrespectful, please report it.)

 
10/27/2006 7:56:20 PMxpert

The fixes resolved the problem. Thanks!
(If this comment was disrespectful, please report it.)

 
11/4/2006 11:43:52 AMOption Explicit

I had two separate email requests to add a property that allows the user to enable/disable the listitem focus rectangle, apparently not everyone like that focus rect. So I added a .ShowSelectRect property, enjoy.
(If this comment was disrespectful, please report it.)

 
11/4/2006 11:51:06 AMOption Explicit

Also, this is version 1.18 now, I forgot to update the title.
(If this comment was disrespectful, please report it.)

 
12/9/2006 12:29:06 PMOption Explicit

Version 1.20 - Added 'MorphBorder' 3D gradient border, tweaked display (focus rect, selection bar, etc.) for XP, added speed comparison demo form, fixed gradient calculation and display bugs for the scrollbar that only became visible when I upgraded from Windows 98 to WinXP. Added .ClearOrSelect public method to allow user to clear or set selected status of supplied range of listitems (or entire list). Made theme property lists more comprehensive. Organized properties.
(If this comment was disrespectful, please report it.)

 
12/11/2006 8:38:21 PMxpert

v1.20: can't compile because now Check2 and Option1 are missing in Form5. Why did you erased the frame? That frame was intended to show the Checkbox Mode!

(If this comment was disrespectful, please report it.)

 
12/13/2006 5:25:26 PMOption Explicit

Sorry Xpert... I intentionally made the Style property read-only at runtime for this most recent update, that's why I took the checkbox etc out of that form. If the demo project doesn't compile correctly sorry about that (not home right now to check). Will reupload a fix for the demo form the next time I update the control itself. Not a big deal though, you guys can work around that.
(If this comment was disrespectful, please report it.)

 
12/13/2006 5:27:39 PMOption Explicit

Oh, and thanks for the vote Steppenwolfe, I appreciate it!
(If this comment was disrespectful, please report it.)

 
1/24/2007 2:41:37 PMaolingo

oh my god !!!
(If this comment was disrespectful, please report it.)

 
2/4/2007 9:47:02 AMRichard Mewett

Glad to see its cracked 50 ***** ratings - well deserved!
(If this comment was disrespectful, please report it.)

 
2/24/2007 1:08:54 AMRob C

Fantastic ctl
With normal lbo, I can auto find with -
lbo.ListIndex = SendMessage(lbo.hwnd, LB_FINDSTRING, -1, ByVal Text1.Text)

I tried with yours, but no success.
I used the default settings of your ctl.
Could it just be a case of changing the properties ?

(If this comment was disrespectful, please report it.)

 
2/24/2007 11:10:22 AMOption Explicit

Hi Rob... this is all ownerdrawn (not a wrapper around a standard listbox) so that won't work. Use my custom .FindIndex method instead.
(If this comment was disrespectful, please report it.)

 
2/24/2007 7:51:22 PMRob C

Thanks for your response.

I have come up with a generic sub that can be called to -
- Find exact match (uses your .FindIndex)
- Find partial (from Left), for AutoFind
- Find partial (anywhere), for Autofind
And it can also be told to -
- Select the found entry
- Scroll To found entry

If anyone is interested, I could post it ?
It is 50 lines (including example calls, and comments)
It would have to be posted here in multiple bits.
(If this comment was disrespectful, please report it.)

 
2/25/2007 12:52:14 PMOption Explicit

Rob, if this sub is something that applies to MorphListBox only, email it to me, and I can incorporate it and resubmit (giving you full credit of course). Thanks for taking interest.
(If this comment was disrespectful, please report it.)

 
3/19/2007 5:10:30 PMOption Explicit

Rob emailed me the code, as it is written it is meant to be pasted into form code. Am looking to incorporate directly into the control when I get the time, which is scarce right now...
(If this comment was disrespectful, please report it.)

 
4/4/2007 8:55:08 PMOption Explicit

Added a .Sort method implementing Phillipe Lord's TriQuickSort algorithm. Not the fastest sort on this site anymore but it fit neatly into this control. I still have some updates to do, including suggestions from Rob C. and Xpert. Will get to them when I have time.
(If this comment was disrespectful, please report it.)

 
4/5/2007 2:34:12 AMJavierSC

X l n ! my 5 balls
(If this comment was disrespectful, please report it.)

 
4/24/2007 11:38:06 AMKen

No Criticism except I am having trouble incorportating the control on a specfice form. I sent 3 emails to Matt yesterday asking for help. When I make a OCX. I get zero didvide errors as soon as I put the control on the form. When I just add the ctl code to the project I get 'Undefined user types' ? But other form in the same project work.
(If this comment was disrespectful, please report it.)

 
4/25/2007 7:22:43 PMOption Explicit

Ken I never received your emails. I have been getting tons of spam lately so I have all "Bulk" mail automatically deleted; apparently it's treating PSC feedback as spam. Sorry about that. Could you please send me a sample project that gives the error? Thanks.
(If this comment was disrespectful, please report it.)

 
4/26/2007 12:13:53 PMKen

I understand I worked out most of it:) Here is what I found.

The Control is great. However here is what I discovered if you want to use it 1) The Ole Automation Reference must be in your VB Application references and it must be at the top of the reference 4th after the 3 required references. It does not matter if you use the list box from an OCX or straight from ".ctl" code copied into your application. You will get unreferenced type errors 2) The MorpListBox Control cannot be drawn at design with a dimension of less than about 300 .height by 300 .width. You will get zero divide errors when running the application even when your application is re-seizing from run time. 3) You cannot resize the MorpListBox Control at run time unless the “ItemImageSize” property is set to one and then at runtime you set this property to something like “MorphListBox1.ItemImageSize = 80. If you do not do this the control will resize but the actual list area will remain as it was at design time.
(If this comment was disrespectful, please report it.)

 
4/26/2007 12:24:31 PMKen

Right now I only have 2 minor issues. What is the “CStopWatch” class all about? Do I need it? The listing text does not honor tabs they come out as the little annoying squares. So you have trouble using a list with columns.
(If this comment was disrespectful, please report it.)

 
4/26/2007 5:16:22 PMOption Explicit

Ken, no you don't need the CStopwatch class; I just put it there so people could compare MorphListBox speed versus the normal VB listbox. As far as tabs go, this control was just meant to be a single column listbox, so I'm not surprised you're having trouble with tabs. There are many excellent grid controls for that purpose on PSC; search for "LynxGrid" by Richard Mewett for an example. Thanks.
(If this comment was disrespectful, please report it.)

 
4/26/2007 5:25:44 PMOption Explicit

As far as the other issues you raised, all I can say is I have had an incredible amount of feedback on this control and it is being used in at least three commercial apps by other people. No one has ever reported issue #1. Issue #2 I have never seen and I use much smaller listboxes than 300x300. I'll look into #3. Thanks for your feeback I really appreciate it.
(If this comment was disrespectful, please report it.)

 
4/28/2007 8:59:00 PMWilliam

Very nice and different! I was expecting the "Vista" look on the forms : | but this feature is not included in the download... can you email me the Vista version? ... it looks very cool that way. 5 globes. Thanks for sharing so much work.
(If this comment was disrespectful, please report it.)

 
4/29/2007 7:50:03 AMOption Explicit

William replied offline but for anyone else who sees the screenshot, the Vista look is simply because I have a new Gateway notebook with Vista installed, it's nothing that I did! :)
(If this comment was disrespectful, please report it.)

 
4/29/2007 10:42:30 AMWilliam

didn't see that one coming! : 0 quite obvious though, hehe, guess you can get the Vista look by using Vista! Thanks for replying OE.
(If this comment was disrespectful, please report it.)

 
5/20/2007 2:20:29 PMKen

When the MorphListBox has focus I cannot seem to trap a "tab key" key press. I tried mouse up, mouse down, and key press. None of these events fire on the Morph Control. The only thing that happens is that the focus rectangle toggles on and off.
(If this comment was disrespectful, please report it.)

 
6/12/2007 6:41:55 PMOption Explicit

Ken, MorphListBox is designed to act like a regular control - when you press Tab, focus shifts to the next control in the tab order. That's why you see the listitem focus rectangle disappear. Sorry it me took so long to reply but I am done with PSC and don't check my PSC email address much anymore...
(If this comment was disrespectful, please report it.)

 
6/5/2009 9:41:11 AMJucko13

This is the most Greatest listbox control ever seen!!! only just one thing is missing for me:P multi-column. i was trying to code it but its a bit to hard for a beginner:P maby if you have some spare time :P and thanx for the control, it realy helped me!!, Jucko13
(If this comment was disrespectful, please report it.)

 
2/22/2010 2:57:26 AMRob C

Is it possible to change the Font, and/or the Font Size ?
(PS I already gave it a 5)
(If this comment was disrespectful, please report it.)

 
2/22/2010 3:15:43 AMRob C

OOPs
Found the Property which is called ListFont
And that single Property will also notice the Font Size if you choose it whilst selecting the Font.
Cool
(If this comment was disrespectful, please report it.)

 
2/28/2010 5:17:31 PMJesus Ruvalcaba

beri nice control tnk
(If this comment was disrespectful, please report it.)

 
11/12/2010 11:05:47 AMRob C

Drag Drop within a single Control ?
Can Drag & Drop be used to reorder Items in a single Listbox ?
Say items 1 to 9 are listed.
Can say 5 be dragged between 8 and 9
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.