void mainList_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.C)
{
StringBuilder copyBuffer = new StringBuilder();
copyBuffer.EnsureCapacity(1);
foreach (ListViewItem item in mainList.SelectedItems)
{
string line = String.Format("{0,40} {1,10}, {2,10}", item.SubItems[1].Text.ToString(), item.SubItems[2].Text.ToString(), item.SubItems[4].Text.ToString());
copyBuffer.EnsureCapacity(copyBuffer.Capacity + line.Length + 1);
copyBuffer.AppendLine(line);
}
if (copyBuffer.Capacity > 1)
{
Clipboard.SetText(copyBuffer.ToString());
}
}
}