[Gtk-sharp-list] block escape key

Renato Salvador renato at star2.com.br
Wed Feb 21 13:20:17 UTC 2018


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.

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;



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/gtk-sharp-list/attachments/20180221/af5d717a/attachment.html>

More information about the Gtk-sharp-list mailing list