Hello,
Could you tell me how can I prevent the size of columns of my listview? Thanks.
Printable View
Hello,
Could you tell me how can I prevent the size of columns of my listview? Thanks.
Hi
Are u talking about Sizing the Column or Resizing the Column.
U can use the below given statement for
Sizing the Column :-
ListView1.View = LVWReport
ListView1.ColumnHeaders.Add ,,300
The third argument is the Column Width. U can change that accordingly to ur wish.
Take Care Bye Bye
Vijooo
Thank you for your reply.
Actually I don't want the width of column can change. I want to lock it. Could you tell me how to do it?
Actually I don't want the size of columns of my listview can change. Could you tell me how can I do that?
Hi
If u dont want ur LVW Column to be resized, then
i dont think that there r some solutions for ur requirements. But i suggest u a cheating way to
overcome this problem.
1) Place the following code in Form Load
Private Sub Form_Load()
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "Sample", 500
End Sub
2) Insert a Timer Control and set the Interval to
100.
3) Then Place the following code in the Timer.
Private Sub Timer1_Timer()
ListView1.ColumnHeaders(1).Width = 500
End Sub
This is the first way and there is another way also. U can use an API Call for that.
Const LVSCW_AUTOSIZE = -1
Const LVSCW_AUTOSIZE_USEHEADER = -2
All the Best. Reply me back
Take Care Bye Bye
Vijooo