List View - Column Resize

  • Thread starter Thread starter Richard Markus
  • Start date Start date
R

Richard Markus

How can I detect in code when a user has resized a column
in a listview control?

Thanks for the help!

Richard
 
Richard,
Don't know if this is what you're looking for, but I save the column width
settings of a listview when its form is closed:

Private Sub frmMain_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
' when user closes frmMain, save the column widths for lvwToDo:
Dim Col As ColumnHeader
For Each Col In lvwToDo.Columns
SaveSetting("ConDots", "frmMain_lvwToDo", Col.Index.ToString,
Col.Width.ToString)
Next
End Sub

and, re-establish the widths every time the form is loaded:

Private Sub frmMain_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' when user opens frmMain, set the column widths for lvwToDo:
Dim Col As ColumnHeader
For Each Col In lvwToDo.Columns
Col.Width = GetSetting("ConDots", "frmMain_lvwToDo",
Col.Index.ToString, "100")
Next
End Sub
Hope this is helpful
Lee
 
Still need more help. I know how to get and set the
column widths. I need to be able to detect when a user
changes them while the program is running - not at load or
unload.

Thanks

Richard
 
Back
Top