c# - Execute commands on AccesKey pressed & release -


so i'm trying execute command when user pressed acceskey , command when user releases acceskey.

i tryed working timer executed code after 500 miliseconds didnt worked out.

so far have this:

public sealed class custombutton : button {  private bool _ispressed = false;   protected override void onaccesskey(accesskeyeventargs e)   {   if (!_ispressed)    {    //execute command when pressed     _ispressed = true;    }      //execute command when acceskey released   }      } 

what have writen not wpf...

wpf in xaml file:

`<button name="btnwebbackward"  width="24"  mousedown="btnwebbackward_mousedown" mouseup="btnwebbackward_mouseup"  ></button>` 

and in code behind:

 private void btnwebbackward_mousedown(object sender, mousebuttoneventargs e)     {      }      private void btnwebbackward_mouseup(object sender, mousebuttoneventargs e)     {      } 

as can see, approach of creating own button have no sense..


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -