本文整理匯總了C#中System.Windows.Forms.ListViewItemSelectionChangedEventArgs.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# ListViewItemSelectionChangedEventArgs.ToString方法的具體用法?C# ListViewItemSelectionChangedEventArgs.ToString怎麽用?C# ListViewItemSelectionChangedEventArgs.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.ListViewItemSelectionChangedEventArgs
的用法示例。
在下文中一共展示了ListViewItemSelectionChangedEventArgs.ToString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: grassListView_ItemSelectionChanged
private void grassListView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
string landType = this.grassLandTypeComboBox.Text;
if (this.grassListView.SelectedIndices.Count > 0 && this.grassListView.SelectedIndices.Count < 4)
{
MessageBox.Show(e.ToString());
Hashtable paintGrassTable = (Hashtable)this.paintGrass[landType];
ArrayList selectedGrassTextures = (ArrayList)paintGrassTable["textures"];
selectedGrassTextures.Clear();
foreach (ListViewItem listViewItem in this.grassListView.SelectedItems)
{
selectedGrassTextures.Add(listViewItem.Text);
}
paintGrassTable["textures"] = selectedGrassTextures;
}
else
{
if (this.grassListView.SelectedIndices.Count <= 3)
{
return;
}
MessageBox.Show("You cannot have more than 3 grasses selected for any given attribute type");
e.Item.Selected = false;
}
}