Hi everybody,

Iam trying to use a window based on the "SysListView32" class with the LVS_ICON style set. What i need is to set the LVS_EX_SIMPLESELECT style but I do not know its value. Also I want to have the WS_EX_CLIENTEDGE style set but using GetWindowLong and SetWindowLong does not work. Last but not least, When user selects one item I want only the text selected, NEITHER its icon NOR a border such that obtained with LVS_EX_BORDERSELECT style.

Regards,

akyprian
Posted on 2003-02-27 07:31:49 by akyprian
(1) question:
#if (_WIN32_IE >= 0x0500)

#define LVS_EX_LABELTIP 0x00004000 // listview unfolds partly hidden labels if it does not have infotip text
#define LVS_EX_BORDERSELECT 0x00008000 // border selection style instead of highlight
#endif // End (_WIN32_IE >= 0x0500)
#if (_WIN32_WINNT >= 0x501)
#define LVS_EX_DOUBLEBUFFER 0x00010000
#define LVS_EX_HIDELABELS 0x00020000
#define LVS_EX_SINGLEROW 0x00040000
#define LVS_EX_SNAPTOGRID 0x00080000 // Icons automatically snap to grid.
#define LVS_EX_SIMPLESELECT 0x00100000 // Also changes overlay rendering to top right for icon mode.
#endif
Posted on 2003-02-27 09:48:09 by beaster
Thanks but if LVS_EX_SIMPLESELECT is for not allowing many items to be selected, I cannot get it to work.
Posted on 2003-02-27 10:34:54 by akyprian
If you want to allow only one item to be selected at a time, create your listview with the LVS_SINGLESEL style.

LVS_SINGLESEL equ 0004h

When you used LVS_EX_SIMPLESELECT you had to create a version 6 manifest as it works only with common controls V6, that is WinXP only. Anyway I don't think it was what you wanted.

LVS_EX_SIMPLESELECT fom MSDN
In icon view, moves the state image of the control to the top right of the large icon rendering. In views other than icon view there is no change. When the user changes the state by using the space bar, all selected items cycle over, not the item with the focus.


Donkey

EDIT : AFAIK the WS_EX_CLIENTEDGE extended style must be used at the time the window is created and cannot be used "on the fly". Could be wrong though, I've never really had to change a window in that way. Is the listview something that you are creating or one from somebody elses program ?
Posted on 2003-02-27 11:12:06 by donkey
(LVS_SINGLESEL equ 0004h)
Thanks for this. This is what I wanted.


(AFAIK the WS_EX_CLIENTEDGE extended style must be used at the time the window is created and cannot be used "on the fly". Could be wrong though, I've never really had to change a window in that way. Is the listview something that you are creating or one from somebody elses program ?)
WS_EX_CLIENTEDGE does work- I ve done it. You have to call MoveWindow after setting this style though. No I am creating the list view my self.

What about my other question? When one item is selected, I do not want its image to be selected(it is a bit ugly) but only its text.

Regards,

akyprian
Posted on 2003-02-28 03:46:04 by akyprian
akyprian,
here's my simple reference app on ext ListView styles.
Posted on 2003-02-28 12:01:59 by The Svin