good afternoon. 

Andrey Gankov worked perfectly by adding the command you suggested. 

if (args.Event.Key == Gdk.Key.Escape) { 

 args.RetVal = true; 

} 

Thanks a lot for the help. 
---

Atenciosamente, 

Em 22/02/2018 09:00, gtk-sharp-list-requ...@lists.dot.net escreveu: 

> Send Gtk-sharp-list mailing list submissions to
> gtk-sharp-list@lists.dot.net
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.dot.net/mailman/listinfo/gtk-sharp-list [1]
> or, via email, send a message with subject or body 'help' to
> gtk-sharp-list-requ...@lists.dot.net
> 
> You can reach the person managing the list at
> gtk-sharp-list-ow...@lists.dot.net
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gtk-sharp-list digest..."
> 
> Today's Topics:
> 
> 1. block escape key (Renato Salvador)
> 2. Re: block escape key (Ганьков Андрей)
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 21 Feb 2018 10:20:17 -0300
> From: Renato Salvador <ren...@star2.com.br>
> To: gtk-sharp-list@lists.dot.net
> Subject: [Gtk-sharp-list] block escape key
> Message-ID: <85ae8a883a106d468dfacd8472a45...@star2.com.br>
> Content-Type: text/plain; charset="utf-8"
> 
> Good Morning. I have the following problem: I have a program in gtk #
> with a main form that when pressing a key the same opens a dialog form
> where in this form I have to block the escape key. because today when
> pressing this key it is recognized in the main form and should not do
> anything in it.
> Good thing that when pressing it does not execute anything in the form
> dialog that is open or in the main form.
> any suggestion?
> I created this event in the form but even so by pressing the key the
> main form also recognizes that it has been pressed and executes the rest
> of the code after the run () of the form dialog.
> 
> [GLib.ConnectBefore]
> protected void KeyPress (object sender, KeyPressEventArgs args)
> {
> if (args.Event.Key == Gdk.Key.BackSpace) {
> 
> if (classModulePrincipal.configuration.EnabledDisplayKeyboard) {
> 
> if (txtValue.Text.Length> = 1)
> classModuloPrincipal.gblobjTeclado.backSpace ();
> }
> }
> 
> if (args.Event.Key == Gdk.Key.Escape) {
> txtFormaPagamento.Text = string.Empty;
> txtValue.Text = string.Empty;
> txtFormaPagamento.IsFocus = true;
> 
> // return;
> }
> }
> 
> -- 
> 
> Atenciosamente, 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> <http://lists.dot.net/pipermail/gtk-sharp-list/attachments/20180221/af5d717a/attachment-0001.html
>  [2]>
> 
> ------------------------------
> 
> Message: 2
> Date: Wed, 21 Feb 2018 17:47:47 +0300
> From: Ганьков Андрей <gankov.and...@inbox.ru>
> To: gtk-sharp-list@lists.dot.net
> Subject: Re: [Gtk-sharp-list] block escape key
> Message-ID: <1cf7dd7d-0867-cac8-ef7a-99c423269...@inbox.ru>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
> 
> In
> 
> if (args.Event.Key == Gdk.Key.Escape) {
> 
> try set args.RetVal = true or may be false
> I think it can stop cascad handle of event. By analogy with other 
> events, setting an excellent value for RetVal, say gtk that the click is 
> processed and other handlers do not need to be called.
> 
> On 21.02.2018 16:20, Renato Salvador wrote: 
> 
>> Good Morning. I have the following problem: I have a program in gtk # 
>> with a main form that when pressing a key the same opens a dialog form 
>> where in this form I have to block the escape key. because today when 
>> pressing this key it is recognized in the main form and should not do 
>> anything in it. Good thing that when pressing it does not execute 
>> anything in the form dialog that is open or in the main form. any 
>> suggestion? I created this event in the form but even so by pressing 
>> the key the main form also recognizes that it has been pressed and 
>> executes the rest of the code after the run () of the form dialog. 
>> [GLib.ConnectBefore] protected void KeyPress (object sender, 
>> KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.BackSpace) { 
>> if (classModulePrincipal.configuration.EnabledDisplayKeyboard) { if 
>> (txtValue.Text.Length> = 1) 
>> classModuloPrincipal.gblobjTeclado.backSpace (); } } if 
>> (args.Event.Key == Gdk.Key.Escape) { txtFormaPagamento.Text = 
>> string.Empty; txtValue.Text = string.Empty; txtFormaPagamento.IsFocus 
>> = true; // return; } }
> 
> -- 
> Andrey Gankov
> Mail:gankov.and...@inbox.ru
> ICQ: 230-684-976
> Jabber:gan...@jabber.ru
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> <http://lists.dot.net/pipermail/gtk-sharp-list/attachments/20180221/14610d11/attachment-0001.html
>  [3]>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> Gtk-sharp-list mailing list
> Gtk-sharp-list@lists.dot.net
> http://lists.dot.net/mailman/listinfo/gtk-sharp-list [1]
> 
> ------------------------------
> 
> End of Gtk-sharp-list Digest, Vol 147, Issue 2
> **********************************************
 

Links:
------
[1] http://lists.dot.net/mailman/listinfo/gtk-sharp-list
[2]
http://lists.dot.net/pipermail/gtk-sharp-list/attachments/20180221/af5d717a/attachment-0001.html
[3]
http://lists.dot.net/pipermail/gtk-sharp-list/attachments/20180221/14610d11/attachment-0001.html
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.dot.net
http://lists.dot.net/mailman/listinfo/gtk-sharp-list

Reply via email to