What exactly is the difference between and .items.clear in delphi 7?

后端 未结 2 787
南方客
南方客 2021-01-08 01:22

I would like to know why are there 2 different ways of clearing out a listview. One is by calling listview.clear and other is listview.items.clear.

2条回答
  •  心在旅途
    2021-01-08 01:57

    ListView.Clear is a convenience method that calls ListView.Items.Clear internally. There is no semantic difference no matter which of the two you call.

    I prefer the first one because it is shorter and it doesn't show the internal representation which is of no interest for me at this point.

提交回复
热议问题