I just started playing around with GDI+ and Owner Drawn Listbox Items... I've started a custom control, and it's all going smoothly except for one aspect..
I'm trying to make a sidebar of some sorts, almost like an outlook bar, but not quite so complex... All i want is a list of icons and corresponding text to run down like a listbox...
the only catch is, i want to create a gdi+ effect when the mouse hovers over an item... What i'm trying to do is make a rounded rectangular box around the listbox item that the mouse is hovering over (VERY similar to the effect that toolbars in windows xp produce when you hover over a toolbar button)...
now, for owner drawn menus, people use this code in the DrawItem event to detect a mouse hover:
VB Code:
If (e.State And DrawItemState.HotLight) = DrawItemState.HotLight Then
This works fine in owner drawn menus, however it appears that the state never shows this even when the mouse is hovering in listbox items... i've got it in my code, and it never returns true...
anyways, i need to find a way to implement this. Perhaps i should look into a different control? The toolbar does not allow for owner drawing... and neither does the listview that i know of (the listview in Large Icon mode would work well if i could do what i wanted to with it.. but i'm afraid i'd run into the same problems as here)...
anyways, i've attatched the .vb file (renamed it .vb.txt because of uploading restrictions) of my usercontrol... i'd appreciate it if someone could take a look at it and help me out... i've spent about 4 hours researching this now, and i haven't come up with anything else... thanks a lot guys!