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

Recommended Answers

All 9 Replies

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

this will give u quick error number 35600

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

35600 index out of bounds

which line ?

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.

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?

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

If all the code is wrong lets see what is your code.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.