0

hi

I have been tryingto make the columnheader of a listview fixed so the user want be able to modify it manually by mouse scrolling but i couldnt find any solution een giving it a fix width didnt work so any ideas i would be thankfull

3
Contributors
9
Replies
10
Views
5 Years
Discussion Span
Last Post by TheChozen
0

try this sample

Dim C As ColumnHeader
 Dim i As Integer
 For i = 1 To 4
 Set C = LV1.ColumnHeaders.Add()
 C.Text = "Field" & i
 C.Width = LV1.Width / 4
 Next i

Edited by debasisdas: n/a

0

and this code doesnt fix headercolumn it makes the ones u set = 0 cant be changed
and it dont work niether :)

0

The index out of bounds error is because The Chosen copied and pasted your code as is. If there is a call to more columns than what exist in the list-view, the error is raised.

@The Chosen, you need to modify Das's code OR paste some of your own so we can see where your error occurred. Also include the line it error ed on.

0

why should i copy an error have nothing to do with my subject i can fix errors easily dont worry thanks for the code but it will not work i know this and i found a simple solution
it cant be done in visual basic much easier right?

0

in my question i simply said giving it a fix width didnt work so any ideas i would be thankfull.
AndreRet thanks for your comment

0

i didnt say ur code is wrong as a vb code it is good 100%
i meant the idea is wrong bec column width cant be fixed by giving a value of number or equal to listview width
its just cant be done as i commented before
thanks for ur time

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.