[MonoDevelop] Is it possible to do the VS equivalent to E.CANCEL in a Gtk.Dialog ?

Michael Hutchinson m.j.hutchinson at gmail.com
Tue Oct 7 20:05:21 EDT 2008


On Tue, Oct 7, 2008 at 5:44 AM, Brett Senior <brett_senior at yahoo.com.au> wrote:
> I am converting an application from MS/VS/VC# to MD/C# and have the need to
> prompt the user for some information in a 'window' that is called from the
> main application.  For this I am using a Dialog and if the response is not
> valid, I want to stop the OK button from exiting with Ok and thus wish to do
> the VS equivalent of e.cancel = true which stops the event from executing
> completely, thus not returning, and thus not returning Ok.  I know that I
> could return a different response but that seems (to me anyway) the wrong
> way to approach the problem.  I looked at the System.EventArgs but there
> were not any fields so I could not see an equivalent.  So, is the above
> possible in a Gtk.Dialog, or is this a case when a Gtk.Window would be
> better (but then I cannot centre the window on the main window as I've been
> there and tried that and this is one of the reasons I am using a Dialog) ?
> It is probably something simple but for the life of me I can't find it !
> Any help would be much appreciated.

int responseCode;
do {
    responseCode = dialog.Run ();
} while (responseCode != cancelValue);

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list