Listview Add Column And Move Column

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Listview Add Column And Move Column

Post by hasantr » 12 Feb 2021, 04:57

I couldn't find anything useful in the listview about adding and replacing columns later. Can you help me find some examples?

I want to add columns and move the added column to the beginning.

Thanks.
User avatar
mikeyww
Posts: 26602
Joined: 09 Sep 2014, 18:38

Re: Listview Add Column And Move Column

Post by mikeyww » 12 Feb 2021, 06:41

One workaround is to create the maximum number of columns, and set some of the widths to zero. I'm not sure about moving them (other than rebuilding).
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Listview Add Column And Move Column

Post by hasantr » 12 Feb 2021, 07:15

mikeyww wrote:
12 Feb 2021, 06:41
One workaround is to create the maximum number of columns, and set some of the widths to zero. I'm not sure about moving them (other than rebuilding).
There is a complicated queue save restore function but I am reluctant to use it. I will probably find a different solution.
Thanks.
just me
Posts: 9425
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Listview Add Column And Move Column

Post by just me » 12 Feb 2021, 07:21

hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Listview Add Column And Move Column

Post by hasantr » 12 Feb 2021, 07:34

just me wrote:
12 Feb 2021, 07:21
LV_InsertCol() :?:
Thanks just me.

When I add a column to the left, the data I add to the first column always goes to the new column. The newly added column becomes the number 1 column. But if I add a column to the far right and move it, then the column rows won't change. That's why I care about moving columns.
just me
Posts: 9425
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Listview Add Column And Move Column

Post by just me » 12 Feb 2021, 08:03

Do you mean "moving columns by drag&drop in the header control"? In this case, the original column index does not change. That's by design.
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Listview Add Column And Move Column

Post by hasantr » 12 Feb 2021, 08:14

just me wrote:
12 Feb 2021, 08:03
Do you mean "moving columns by drag&drop in the header control"? In this case, the original column index does not change. That's by design.
Yes true. I also want to provide this with code. User won't drag and drop. I want to change the column location with the code, but I don't want the index number to change.

It is exactly. I want the index number to remain constant. I want if the index does not change when the column is dragged. But how can I replace the columns with the ahk code?
User avatar
mikeyww
Posts: 26602
Joined: 09 Sep 2014, 18:38

Re: Listview Add Column And Move Column

Post by mikeyww » 12 Feb 2021, 09:44

Thank you, @just me!
just me
Posts: 9425
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Listview Add Column And Move Column

Post by just me » 12 Feb 2021, 09:53

@mikeyww, you're welcome.
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Listview Add Column And Move Column

Post by hasantr » 13 Feb 2021, 04:40

just me wrote:
12 Feb 2021, 09:31
LV_EX_(Get/Set)ColumnOrder()
Thanks @just me. I love using this library in my work. I wanted to find out if there is a method other than a function. But I will continue with this. Thanks for everything.
Post Reply

Return to “Ask for Help (v1)”