Removing White Space from ListView

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
pmoshiri
Posts: 17
Joined: 14 Feb 2020, 13:12

Removing White Space from ListView

08 Mar 2021, 11:21

I am trying to get rid of the white space that appears on the left of my single row list view. I am utilizing the LV_Colors function so this looks a bit funky. Here is what I am referring to(to the left of the green box:

https://imgur.com/TZUjoI6

Any help would be greatly appreciated.

Code: Select all

gui,30:Add, ListView, hWndscanitemlist gscanitemlist x175 y753 w302 h92 +grid -hdr  -SORT vLV1, 1|2
LV_ModifyCol(1,"145")
LV_ModifyCol(2,"145")
LV_ModifyCol(3,"210")
LV_ModifyCol(4,"95")
Gui,30: ListView, LV1
LV_SetImageList( DllCall( "ImageList_Create", Int,2, Int,87, Int,0x18, Int,1, Int,1 ), 1 )
LV_Colors.Attach(scanitemlist)
row:=1
LV_Colors.Cell(scanitemlist, row, 1,0x00FF00, 0x000000)
LV_Colors.Cell(scanitemlist, row, 2,0xFF0000 , 0x000000)
Attachments
image.png
image.png (5 KiB) Viewed 336 times
pmoshiri
Posts: 17
Joined: 14 Feb 2020, 13:12

Re: Removing White Space from ListView

09 Mar 2021, 10:24

I appreciate your response. I looked at the link and it seems to move the entire control. I am just trying to remove the margin shown below:
image.png
image.png (10.07 KiB) Viewed 270 times
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: Removing White Space from ListView

10 Mar 2021, 00:20

pmoshiri wrote:
08 Mar 2021, 11:21
I am trying to get rid of the white space that appears on the left of my single row list view.
When an image list is attached to a ListView control, the control will automatically allocate space for images from the image list. The space on the left side of the 1st column is not white space or a margin, that is the space that is reserved for an image.

One way to hide the extra space is to create 3 columns instead of 2 and then set the width of the 1st column to 0. That will hide the 1st column and the extra space for the row image. Then use column 2 as the leftmost column and column 3 as the next column.

Something to try. I hope this helps.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, DiegoSouto, Google [Bot], mikeyww, Rohwedder, Swiftly9767 and 380 guests