private void button2_Click(object sender, EventArgs e) { Reader r = new Reader(); Librarian l = new Librarian(); try { List <string> Li = new List <string>(); if (radioButton3.Checked) { Li = r.forget_Signin_data(forgetmailtext.Text); string user_name = Li[0]; string Password = Li[1]; if (Password == "" && user_name == "") { MessageBox.Show("Entered mail is incorrect"); } else { MessageBox.Show("You user name is : " + user_name + "/ " + "Your password is : " + Password); } } else if (radioButton4.Checked) { Li = l.forget_Signin_data(forgetmailtext.Text); string user_name = Li[0]; string Password = Li[1]; if (Password == "" && user_name == "") { MessageBox.Show("Entered mail is incorrect"); } else { MessageBox.Show("You user name is : " + user_name + "/ " + "Your password is : " + Password); } } } catch (Exception) { MessageBox.Show("You forget to select required data"); } forgetmaillabel.Visible = false; forgetmailtext.Visible = false; radioButton3.Visible = false; //Reader radioButton4.Visible = false; //Librarian button2.Visible = false; }