ApplicationEx.ShowDialog

  • Thread starter Thread starter Jakov
  • Start date Start date
J

Jakov

Hi,

I have read a few posts on this newsgroup about how to enable a dialog
opened with ApplicationEx.ShowDialog to return after it is closed but I
cannot get it working. I tried to set the dialog result first then closing
but that didn't fix the problem. The reason for using
ApplicationEx.ShowDialog in the first place was to enable me to use a
message filter. The message filter works great I just can't get the form to
return. Anyone know the trick to get this working?

Thanks
-J
 
I once created a "skinned" message box. This message box worked alot
like the default windows version, however it matched the look/feel of
my application. When this message box appeared, the main UI thread
would pause until a response was recovered from the form.

The code that I had tied to the submit button is as follows

private void Selection_Click(object sender, System.EventArgs e)
{
string buttonType = ((ImageButton)sender).customTag;

switch(buttonType)
{
case "OK":
SelectedResult = DialogResult.OK;
break;

case "YES":
SelectedResult = DialogResult.Yes;
break;

case "NO":
SelectedResult = DialogResult.No;
break;

case "CANCEL":
SelectedResult = DialogResult.Cancel;
break;

default:
break;
}

Application.DoEvents();
this.DialogResult = SelectedResult;
this.Close();
// this.Hide();
}

My messagebox was static, and thus was called like this

DialogResult _result;
_result = ImageMessage.Display(ImageMessage.Style.Ok, MESSAGE_TITLE,
"My message here");

switch(_result)
{
blah blah ..
}

This I know for a fact works, I hope it pushes you in the right
direction.


--
I hope this helps

--
Norman Rericha
Senior Software Engineer
Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member
 
Back
Top