News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Listbox and ImageList

Started by ragdog, January 23, 2011, 01:40:35 PM

Previous topic - Next topic

ragdog

It is possible to use a ImageList with a listbox

I use a ImageList for listview and treeview to draw a bmp
can i use this for a listbox?

Greets,

Tedd

I don't think so, without subclassing and drawing the images yourself. (It doesn't appear to support custom-draw either.)
Why not use a single column listview?
No snowflake in an avalanche feels responsible.

ragdog

QuoteWhy not use a single column listview?

Yes this ist the simply way but how i can hide this column header?
disable the column header can i with this

invoke SendMessage,hList,LVM_GETHEADER,0,0
invoke EnableWindow,eax,FALSE

I need a hide column header function then have i a listbox :bg

Gunner

Quote from: ragdog on January 23, 2011, 04:53:04 PM
Yes this ist the simply way but how i can hide this column header?
disable the column header can i with this

invoke SendMessage,hList,LVM_GETHEADER,0,0
invoke EnableWindow,eax,FALSE

I need a hide column header function then have i a listbox :bg

Why not just create the listview with the styles:
LVS_REPORT
LVS_NOCOLUMNHEADER
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

ragdog


donkey

Hi Ragdog,

I didn't see this thread til now. You can use ownerdrawn listboxes for this. I have attached an example that uses an imagelist and displays the images in the listbox.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ragdog


ragdog

I have change it to a listview for use a imagelist

now have i a question by a listbox can i use LB_SETITEMDATA and LB_GETITEMDATA
for add True and false (if checked or not) gives this for a listview?

donkey

Quote from: ragdog on January 29, 2011, 06:54:18 PM
I have change it to a listview for use a imagelist

Why would you need to do that ? As I showed in my example using an image list with a listbox is a simply an ownerdraw issue.

Quotenow have i a question by a listbox can i use LB_SETITEMDATA and LB_GETITEMDATA
for add True and false (if checked or not) gives this for a listview?

No, those messages are for listboxes only, however you can use LVM_SETITEM and use the LVITEM.lParam or LVITEM.iImage members to track check marks. In my example the ITEMDATA is used to retain the image index.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ragdog

Your example if very good but i have thinking about my project and i need more as a one column ::)
Sorry I think your exmple can i use for a other project :U

Thanks for this LVM tip

donkey

Quote from: ragdog on January 30, 2011, 03:27:21 AM
Your example if very good but i have thinking about my project and i need more as a one column ::)
Sorry I think your exmple can i use for a other project :U

Thanks for this LVM tip

Ah, well then a listbox was never what you required, a listview handles multiple columns quite well. Though I have used listboxes for columns in the past it was for a custom control and the code is lost in my archives and not very useful in this case. Good luck with the project.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable