C# Класс CustomListView.ListViewEx

Class derived from ListView to give ability to display controls like TextBox and Combobox
Наследование: System.Windows.Forms.ListView
Показать файл Открыть проект

Открытые методы

Метод Описание
AddComboBoxCell ( int row, int col, StringCollection data ) : void

Set a combobox in a cell

AddComboBoxCell ( int row, int col, string data ) : void

Set a combobox in a cell

AddEditableCell ( int row, int col ) : void

Set a text box in a cell

ListViewEx ( ) : System

Constructor

Защищенные методы

Метод Описание
OnMouseDown ( MouseEventArgs e ) : void

OnMouseUp ( MouseEventArgs e ) : void

Приватные методы

Метод Описание
GetDropDownWidth ( StringCollection data ) : int

This message will get the largest text from the given stringarray, and will calculate the width of a control which will contain that text.

GetKey ( SubItem cell ) : SubItem

For this method, we will get a Subitem. Then we will iterate thru each of the keys and will check whther any key contains the given cells row/column. If it is not found we will check for -1 in any one

GetSubItemRect ( Point clickPoint ) : System.Windows.Forms.RECT

This method will send LVM_GETSUBITEMRECT message to get the current subitem bouds of the listview

InitializeComponent ( ) : void

Initializes the text box and combo box

ShowComboBox ( Point location, Size sz, StringCollection data ) : void

This method will display the combobox

ShowTextBox ( Point location, Size sz ) : void

This method will display the textbox

ValidateAndAddSubItems ( ) : void

combo_SelectedIndexChanged ( object sender, EventArgs e ) : void

This event handler wll set the current text in the combobox as the listview's current cell's text, while the combobox selection is changed

textBox_Leave ( object sender, EventArgs e ) : void

This event handler wll set the current text in the textbox as the listview's current cell's text, while the textbox focus is lost

Описание методов

AddComboBoxCell() публичный Метод

Set a combobox in a cell
public AddComboBoxCell ( int row, int col, StringCollection data ) : void
row int The 0-based index of the item. Give -1 if you /// want to set a combo box for every items for a /// given "col" variable. ///
col int The 0-based index of the column. Give -1 if you /// want to set a combo box for every subitems for a /// given "row" variable. ///
data System.Collections.Specialized.StringCollection Items of the combobox ///
Результат void

AddComboBoxCell() публичный Метод

Set a combobox in a cell
public AddComboBoxCell ( int row, int col, string data ) : void
row int The 0-based index of the item. Give -1 if you /// want to set a combo box for every items for a /// given "col" variable. ///
col int The 0-based index of the column. Give -1 if you /// want to set a combo box for every subitems for a /// given "row" variable. ///
data string Items of the combobox ///
Результат void

AddEditableCell() публичный Метод

Set a text box in a cell
public AddEditableCell ( int row, int col ) : void
row int The 0-based index of the item. Give -1 if you /// want to set a text box for every items for a /// given "col" variable. ///
col int The 0-based index of the column. Give -1 if you /// want to set a text box for every subitems for a /// given "row" variable. ///
Результат void

ListViewEx() публичный Метод

Constructor
public ListViewEx ( ) : System
Результат System

OnMouseDown() защищенный Метод

protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
Результат void

OnMouseUp() защищенный Метод

protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
Результат void