[Gtk-sharp-list] gtk message dialog yes/no set focus button yes monodevelop

Baltasar García Perez-Schofield baltasarq at gmail.com
Tue Jan 31 09:10:04 UTC 2017


Hi,

If you want to have the dialog with the button "yes" set by default, then
add the line:
md1.DefaultResponse = Gtk.ResponseType.Yes;

Before the md1.Run() line. Also, remove the md1.Show() line, you don't need
that.

-- Baltasar


El lun., 30 ene. 2017 a las 20:58, salvadorRenato (<renato at star2.com.br>)
escribió:

> hi,
>
> I am creating a messagedialog with button type yesNo
> But it starts as the button in the selected, I would like to put the button
> yes set focus default.
>
> How can this be done?
>
> Example code
>
> MessageDialog md1 = new MessageDialog (null, DialogFlags.Modal,
> MessageType.Info, ButtonsType.YesNo,"Registrar Item? ");
>
>                         ResponseType response = (ResponseType)md1.Run ();
>
>                         md1.Show ();
>
>                         if (response == ResponseType.No) {
>                                 md1.Destroy ();
>                         else
>                             ......
>
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/gtk-message-dialog-yes-no-set-focus-button-yes-monodevelop-tp4669869.html
> Sent from the Mono - Gtk# mailing list archive at Nabble.com.
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.dot.net
> http://lists.dot.net/mailman/listinfo/gtk-sharp-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/gtk-sharp-list/attachments/20170131/6e1fbc17/attachment.html>


More information about the Gtk-sharp-list mailing list