Control-listview
The contents of the caption are determined by the Columns collection, and the Columns property is selected in the Properties window .
Then clicking the Small button appears opens the ColumnHeader collection Editor click Add. Modify the "Text" and "Width" properties, and you need several columns to add a few columns. The elements in the Add column are collections of items in the attribute.
and the first column of the "villain" icon is set by Items.imageindex, which provides a picture of the ImageList control (image List control).
The only function of the ImageList control is to store the image for use by other controls. The image is stored in the images collection. The ImageSize property size is set to the first loaded image size.
ListView allowed to connect to three ImageList respectively
u largeimagelist for connecting large icons 32x32
u smallimagelist for connecting small icons 16x16
u stateimagelist for state image connection
The View property setting displays five different views.
Details: You can display any column, but only the first column can contain a small icon and label, and other column items can only display text information, there are list headers. (The effect is shown in the figure below)
LargeIcon: Each item is displayed as a maximized icon, with a label underneath it. (The effect is shown in the figure below)
SmallIcon: Each item is displayed as a small icon with a label on its right. (The effect is shown in the figure below)
List: Each item is displayed as a small icon with a label on its right. The items are arranged in columns with no column headers. (The effect is shown in the figure below)
Tile: Each item is displayed as a full size icon with item labels and child information on its right. (Only Windows XP and Windows Server 2003 series support)
Common basic Properties
(1) Fullrowselect: Set whether the row selection mode. (default to False) Tip: This property makes sense only in the details view.
(2) Gridlines: Sets whether grid lines are displayed between rows and columns. (default to False) Tip: This property makes sense only in the details view.
(3) Allowcolumnreorder: Sets whether the column headers can be dragged to change the order of the columns. (default to False) Tip: This property makes sense only in the details view.
(4) MultiSelect: Sets whether multiple items can be selected. (Default is False)
(5) HeaderStyle: Gets or sets the column header style.
Clickable: Column headers act like buttons, and you can perform actions (such as sorting) when clicked.
Nonclickable: Column headers do not respond to mouse clicks.
None: Column headers are not displayed.
(6) LabelEdit: Sets whether the user can edit the label of the item in the control, and for the detail view, you can edit only the contents of the first column of the row. (Default is False)
(7) Checkboxes: Sets whether the check box appears next to the items in the control. (Default is False)
(8) LargeImageList: Large icon set. Tip: Use only in LargeIcon view.
(9) SmallImageList: Small icon set. Tip: Only used in SmallIcon view.
(a) StateImageList: Image mask. These image masks can be used as overlay graphs for largeimagelist and smallimagelist images that indicate the application-defined state of the item. (Not a moment to understand)
(one) SelectedItems: Gets the item selected in the control.
(CheckedItems): Gets the item selected by the current check box in the control.
(soritng): Sorts items in a list view. (Default to None)
Ascending: Items are sorted in ascending order.
Descending: Items are sorted in descending order.
None: Items are not sorted.
(scrollable): Sets whether scroll bars are displayed when there is not enough space to display all items. (Default is True)
(hoverselection): Sets whether items are automatically selected when the mouse pointer hovers over an item. (Default is False)
(hottracking): Sets the appearance of a hyperlink when the mouse pointer passes over the item text. (Default is False)
(hideselection): Sets whether the selected item is still highlighted when the control has no focus. (Default is False)
(showgroups): Sets whether items are displayed in groups. (the default is false);
(Groups): Sets the set of objects that are grouped.
(Topitem): Gets or sets the first visible item in the control that can be used for positioning. ( the effect is similar to the EnsureVisible method):
(1) BeginUpdate: Avoid describing the control before calling the EndUpdate method. When you insert a large amount of data, you can effectively avoid flashing the control and greatly increase the speed.
(2) EndUpdate: After the BeginUpdate method hangs the description, continue to describe the list view control. (End update)
(3) EnsureVisible: List view scrolling navigates to the option row for the specified index entry. (The effect is similar to the Topitem property)
(4) FindItemWithText: Finds the first ListViewItem that begins with a given text value.
(5) FindNearestItem: Finds the next item from the given point according to the specified search direction. Tip: You can use this method only in the LargeIcon or SmallIcon view. Common events:
(1) AfterLabelEdit: Occurs when the user edits the label of an item, and requires the LabelEdit property to be true.
(2) BeforeLabelEdit: Occurs when the user begins to edit the label of an item.
(3) Columnclick: Occurs when the user clicks a column header in a list view control.
First of all, preliminary understanding. Follow-up will also enhance the learning of the Code