C# Class CustomListView.ListViewEx

Class derived from ListView to give ability to display controls like TextBox and Combobox
Inheritance: System.Windows.Forms.ListView
ファイルを表示 Open project: powerumc/vsgesture

Public Methods

Method Description
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

Protected Methods

Method Description
OnMouseDown ( MouseEventArgs e ) : void

OnMouseUp ( MouseEventArgs e ) : void

Private Methods

Method Description
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

Method Details

AddComboBoxCell() public method

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 ///
return void

AddComboBoxCell() public method

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 ///
return void

AddEditableCell() public method

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. ///
return void

ListViewEx() public method

Constructor
public ListViewEx ( ) : System
return System

OnMouseDown() protected method

protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
return void

OnMouseUp() protected method

protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
return void