Columns.Add and resizable

The place for threads about TimoSoft ExplorerListView.
Post Reply
User avatar
Mex
Captain
Posts: 130
Joined: 24 Sep 2009, 19:47

Columns.Add and resizable

Post by Mex »

Hello Timo!

When i add columns and set the resizable = False, it does not work i can still change columns width.
Is this a bug or am i missing something? (Windows 7)


Alles gute;
Meelis
User avatar
Mex
Captain
Posts: 130
Joined: 24 Sep 2009, 19:47

Re: Columns.Add and resizable

Post by Mex »

Ok its working nut not as i expected :)
Let's say i have 3 columns
First columns width is set to 0 and resizable to False.
2 other columns are lets say 200px.(see pics)

With mouse i can still change first columns width and now when its visible then its "locked".


BR;
Meelis
Attachments
sc2.jpg
(24.48 KiB) Not downloaded yet
sc1.jpg
(37.08 KiB) Not downloaded yet
User avatar
Mex
Captain
Posts: 130
Joined: 24 Sep 2009, 19:47

Re: Columns.Add and resizable

Post by Mex »

Ok found a solution how to "lock" hidden column, but dont know if this is a right way :)

Private Sub theList_ResizingColumn(ByVal column As ExLVwLibUCtl.IListViewColumn, newColumnWidth As Long, abortResizing As Boolean)
If column.Width = 0 Then
newColumnWidth = 0
End If
End Sub
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: Columns.Add and resizable

Post by TiKu »

This sounds like a bug of comctl32.dll, but I'll check (not today).

To comment your work-around: Why don't you set abortResizing to True?
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: Columns.Add and resizable

Post by TiKu »

I can confirm that this is a bug in comctl32.dll. You've already found the best work-around (except for the abortResizing thing).
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
engee30
Lt. Commander
Posts: 54
Joined: 25 Sep 2012, 19:49
Location: Swindon, UK
Contact:

Re: Columns.Add and resizable

Post by engee30 »

Hi

I have a little problem dealing with columns, or rather headers. Once you drag one of the headers, its position changes, but the header index remains the same. Say, I've got three columns. When in normal order, Header indexed 0 is in Position 0, Header indexed 1 in Position 1, and Header indexed 2 in Position 2. If I drag Header indexed 1 into Position 0, it obviously retains the index 1, and changes its position from 1 to 0. Is it possible for the dragged header to change its index as well? I would like to iterate and print the the names of the headers in the order they are positioned, and not according to their indices, in a loop like:

Code: Select all

Dim a as Long
for a = 0 to lvw.columns.count -1
Print lvw.columns(a).caption
next
This way, you'll get:
"Header Caption 0"
"Header Caption 1"
"Header Caption 2"

but I'd like to get:
"Header Caption 1" (dragged from position 1 to 0)
"Header Caption 0" (moved from position 0 to 1)
"Header Caption 2" (remained the same)
:x

Regards
Pete
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: Columns.Add and resizable

Post by TiKu »

The index cannot be changed, but you can access the headers by position:

Code: Select all

Dim a as Long
for a = 0 to lvw.columns.count -1
Print lvw.columns(a, citPosition).caption
next
By the way, if you need this in order to persist the column order, you should think about using the Columns.PositionsString property instead.

Regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
engee30
Lt. Commander
Posts: 54
Joined: 25 Sep 2012, 19:49
Location: Swindon, UK
Contact:

Re: Columns.Add and resizable

Post by engee30 »

Oh, that was another simple, yet perfect solution. Thanks again. :D
Pete
Post Reply