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

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

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -