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
Columns.Add and resizable
Re: Columns.Add and resizable
Ok its working nut not as i expected ![Smile :)](./images/smilies/icon_e_smile.gif)
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
![Smile :)](./images/smilies/icon_e_smile.gif)
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
Re: Columns.Add and resizable
Ok found a solution how to "lock" hidden column, but dont know if this is a right way ![Smile :)](./images/smilies/icon_e_smile.gif)
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
![Smile :)](./images/smilies/icon_e_smile.gif)
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
Re: Columns.Add and resizable
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?
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!
Boycott DRM! Boycott HDCP!
Re: Columns.Add and resizable
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!
Boycott DRM! Boycott HDCP!
Re: Columns.Add and resizable
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:
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)
Regards
Pete
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
"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)
![Mad :x](./images/smilies/icon_mad.gif)
Regards
Pete
Re: Columns.Add and resizable
The index cannot be changed, but you can access the headers by position:
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
Code: Select all
Dim a as Long
for a = 0 to lvw.columns.count -1
Print lvw.columns(a, citPosition).caption
next
Regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
Re: Columns.Add and resizable
Oh, that was another simple, yet perfect solution. Thanks again.
Pete
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Pete