tags:

views:

190

answers:

1

I'm using the following code to show a message dialog in my application :

MessageDialog dialog = new MessageDialog(null,
                                         DialogFlags.Modal,
                                         MessageType.Error, 
                                         ButtonsType.Ok,
                                         "An error occured: " );
dialog.Run();

Problem is the Ok button on the window doesn't do anything.... The window only disappears when i hit the X button on top right corner.

Any ideas?

+3  A: 

You need to call dialog.Destroy(); after your call to dialog.Run();

DoR