I want to check if a checkbox is selected on a form, since I'm working with several forms.
Using the following code does not work:
frmPrincipal f = new frmPrincipal();
if (f.chkNotificacao.Checked == true)
{
f.notifyIcon1.ShowBalloonTip(1000, "Notificação",
"Um novo usuário foi cadastrado.", ToolTipIcon.Info);
}
If I put it this way to test, it works, but it will always leave it as true:
frmPrincipal f = new frmPrincipal();
f.chkNotificacao.Checked = true;
if (f.chkNotificacao.Checked == true)
{
f.notifyIcon1.ShowBalloonTip(1000, "Notificação",
"Um novo usuário foi cadastrado.", ToolTipIcon.Info);
}
Is there any other way to do a checkbox check from another form? Well, I need to do the verification.
If a new user is created, this checkbox is checked to trigger a notification.