Jump to content
Sign in to follow this  
bshoenhair

How can I remove ListView Items & Hide a column

Recommended Posts

bshoenhair

I have a listview in my GUI and I have a couple of issues I am unable to tackle:

1. How can I remove the selected item(s) from the gui listview ?

2. How can I hide a column in the gui listview ? I tried a blank string that should work but it doesn't, seems that extra spaces are added as a default so you are unable to hide a column.

Share this post


Link to post
Share on other sites
LOULOU

For deleting an item in a listview

$LVM_DELETEITEM = $LVM_DELETEITEM = 0x1008

GuiCtrlSendMsg($listview, $LVM_DELETEITEM, current_selection , 0)

For the second question go on microsoft website

at the following adress

http://msdn.microsoft.com/library/default...._deleteitem.asp

on the left part of the screen you have an explanation about all LV_xxx command I am sure you find sure to find what you search for

Edited by LOULOU

Share this post


Link to post
Share on other sites
bshoenhair

@LOULOU

Where did you find '0x1008' that is related to $LVM_DELETEITEM ?

I checked but could not find any info on how to hide a column.

Share this post


Link to post
Share on other sites
bshoenhair

OK, I can now delete the selected item with

$LVM_DELETEITEM = 0x1008
$ItemCount = ControlListView("listview items","",$listview,"GetItemCount")
For $i = 0 To $ItemCount - 1
   If ControlListView("listview items","",$listview,"IsSelected",$i) Then 
   GuiCtrlSendMsg($listview, $LVM_DELETEITEM,$i,0)
   $i = $i - 1
EndIf
Next

But still can't figure out how to hide a column

Any help appreciated.

Share this post


Link to post
Share on other sites
Holger

! You can NOT hide a column but only DELETE it !!!

$LVM_DELETECOLUMN = 0x101C
...
$col = 3
GUICtrlSendMsg($listview,$LVM_DELETECOLUMN,$col,0)

So long...

Edit: if you are looking for the values for the commands try searching via google for "winuser.h" or "commctrl.h".

Edited by Holger

Share this post


Link to post
Share on other sites
Jos

! You can NOT hide a column but only DELETE it !!!

$LVM_DELETECOLUMN = 0x1028
...
$col = 3
GUICtrlSendMsg($listview,$LVM_DELETECOLUMN,$col,0)

So long...

Edit: if you are looking for the values for the commands try searching via google for "winuser.h" or "commctrl.h".

<{POST_SNAPBACK}>

would setting the columnwidth to 0 do it ?

(LVM_SETCOLUMNWIDTH)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Holger

@JdeB: oohhh, sorry...yep, great idea :lol::D

Thanks for info :idiot:

Forgot:

$LVM_SETCOLUMNWIDTH = 0x101E
...
$col = 3
GUICtrlSendMsg($listview,$LVM_SETCOLUMNWIDTH,$col,0)
Edited by Holger

Share this post


Link to post
Share on other sites
bshoenhair

@JdeB: oohhh, sorry...yep, great idea :lol::D

Thanks for info :idiot:

Forgot:

$LVM_SETCOLUMNWIDTH = 0x1030
...
$col = 3
GUICtrlSendMsg($listview,$LVM_SETCOLUMNWIDTH,$col,0)

<{POST_SNAPBACK}>

This is not working for me, anyone else experiencing this ?

Share this post


Link to post
Share on other sites
bshoenhair

Great, thanks thanks for the help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×