how to fix the column width of a listview in c# windows form?

后端 未结 4 863
野性不改
野性不改 2021-01-13 20:43

i have a listview i need to fix the column width of the listview so that at run time user cannot drag the columnheaders and resize it.....what is the procedure?? i have sear

4条回答
  •  庸人自扰
    2021-01-13 21:10

    Thanks a lot I've used it in vb.net as

     Private Sub ListView1_ColumnWidthChanging(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnWidthChangingEventArgs) Handles ListView1.ColumnWidthChanging
         e.Cancel = True
         e.NewWidth = ListView1.Columns(e.ColumnIndex).Width    
     End Sub
    

提交回复
热议问题