I have a form displayed by a static method.
This static method calls ShowDialog in the form:
public static LockDetails Lock(string lockedMessage, object[] params parameters)
{
using (LockWaitForm form = new LockWaitForm(parameters))
{
form._lockedMessage.Text = lockedMessage;
DialogResult result = form.ShowDialog();
return new LockDetails (form._lockStatus, form._lock);
}
}
What I want is the OnLoad method for the dialog to wait up to one second before it appears, so it will only appear if the write lock cannot be reached after 1 second. It will happily drop out to one second if the lock is received before 1 second by setting its DialogResult to the OK position.
, 1 . "Visible = false" , , . , " " , , .
, ShowDialog? PInvoke ( -64- )
Load, , ShowDialog. ,