private void Predstave_comboBox1_Validating(object sender, CancelEventArgs e) { if (Predstave_comboBox1.SelectedIndex < 0) { OdabirPredstave_errorProvider1.SetError(Predstave_comboBox1, "Odaberite predstavu"); OdabirPredstave_errorProvider1.Icon = Properties.Resources.er; validacija = false; } else { OdabirPredstave_errorProvider1.SetError(Predstave_comboBox1, "Odabrana predstava"); OdabirPredstave_errorProvider1.Icon = Properties.Resources.Check; validacija = true; } }
private void InfoPredstave_button1_Click(object sender, EventArgs e) { if (validacija == true) { OdabirPredstave_errorProvider1.Clear(); int indexpro = Programi_comboBox1.SelectedIndex; int index = Predstave_comboBox1.SelectedIndex; Predstava info = RPR.Programi[indexpro].Predstave[index]; InfoPredstave frm = new InfoPredstave(info); frm.Show(); } else { OdabirPredstave_errorProvider1.SetError(Predstave_comboBox1, "Odaberite predstavu"); OdabirPredstave_errorProvider1.Icon = Properties.Resources.er; validacija = false; } }