private void setToToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedIndices.Count == 0) { return; } FormNumberInput FNI = new FormNumberInput("Set new limit", 0, 1000, OrderContainer.GetLimit(listView1.SelectedIndices[0]), 2); if (FNI.ShowDialog() == System.Windows.Forms.DialogResult.OK) { OrderContainer.SetLimit(listView1.SelectedIndices[0], FNI.Value); } }