0

Hello, I have a listview1 in my form. And my form has the ability to fullscreen itself.
In the meantime, I have this code:

ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize)

But that would only depend on the listview's headersize. or the column's header width.
I would like my all columns to share equal width. For example: listview is 40px width
and there are 4 columns, of course each columns should have 10px.

Is that possible? pls help.

2
Contributors
2
Replies
11
Views
3 Years
Discussion Span
Last Post by deceptikon
0

Hello, this would be my second time in posting a question which I solved by myself. I was waiting but no one replied and I was just finding out how to resize the listview header column's width by code. The second step will be easy.
Now, the solution is:

    width = ListView1.ClientSize.Width / 7

    ColumnHeader1.Width = width 
    ColumnHeader2.Width = width 
    ColumnHeader3.Width = width 
    ColumnHeader4.Width = width 
    ColumnHeader5.Width = width 
    ColumnHeader6.Width = width
    ColumnHeader7.Width = width
0

Hello, this would be my second time in posting a question which I solved by myself.

Well done. Being able to solve your problems yourself is a great ability to cultivate. Unfortunately, a lot of people will ask a question and then stop working on it in the hope that someone else will answer it.

Edited by deceptikon

This question has already been answered. 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.