Wrote a login custom dialogbox
static LoginDialog loginDialog;
public static bool ShowLoginDialog()
{
result = false; // Success
loginDialog = new LoginDialog();
loginDialog.ShowDialog();
loginDialog.BringToFront();
loginDialog.TopMost = true;
loginDialog.Activate();
return result;
}
I call it from another form whitout my interaction, it is fire up when timer ticked:
LoginDialog.ShowLoginDialog();
The problem is the login screen does not focus on top of the current open form.
How can I solve this problem? Thank you.
I’m assuming your
LoginDialogis just another Form. Try this –In the
MainForm:In the
LoginDialog:NOTE: I have no idea what the
resultvariable you are using for.