private void button1_Click(object sender, EventArgs e) { int x = (int)numericUpDown1.Value - 1; if (x >= 0 && x < res.testers.Count) { testerView tv = new testerView(res.testers[x], res.selectedOprosnik.elements); tv.ShowDialog(); } else { MessageBox.Show("Неверный номер"); } }
private void button2_Click(object sender, EventArgs e) { if (newSearch) { finded.Clear(); Temp = 0; Count = 0; if (listBox1.SelectedItem != null && textBox1.Text != "") { int ank = listBox1.SelectedIndex; for (int i = 0; i < res.testers.Count; i++) { if (res.testers[i].anketa[ank].Contains(textBox1.Text)) { finded.Add(i); Count++; } } } if (Count > 0) { newSearch = false; } } if(!newSearch) { try { testerView tv = new testerView(res.testers[finded[Temp]], res.selectedOprosnik.elements); tv.ShowDialog(); seeTempCount(); Temp++; if (Temp >= Count) Temp = 0; } catch { } } }