hi,
i work on a windows application and i have a principal form which show another form in its load event:
private void FormPrincipal_Load(object sender, EventArgs e)
{
FormR fp = new FormR();
fp.Show();
}
the form FormR contain this code in its load event:
private void FormR_Load(object sender, EventArgs e)
{
// code of retrieving data from database
if (rrs1 == 0) // if there is no data retrieving
{
MessageBox.Show(" there are no persons");
this.Hide();
}
else
{
// code of showing data in datagridview control
}
}
the problem is that when there no data retrieved from database ( the condition of "if" is checked) the form FormP is shown for second once.
thanks