How to hide a column in a ListView control?

后端 未结 9 2345
慢半拍i
慢半拍i 2021-02-14 03:01

How can I hide a column in a ListView control, without setting the column Width property to 0?

Also, can I lock the Width

9条回答
  •  天涯浪人
    2021-02-14 03:17

    The simplest way as follows, try this code segment :

    hide:

          LVW.Columns.Item(0).Width = 0
    

    show again:

          LVW.Columns.Item(0).AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent)
    

    may this help someone.

提交回复
热议问题