c# - How to trigger FocusVisualStyle by clicking on a button? -
here questions :
- is possible trigger focusvisualstyle when click event of button occurs ?
- is possible make button not have focusvisualstyle ?
i found kind of answer second question.
i assigned new focusvisualstyle button below, , deleted rectangle control in controltemplate controltemplate empty.
i appreciate if have better way or if can answer first question.
<window.resources>     <style x:key="myfocusvisualstyle">         <setter property="control.template">             <setter.value>                 <controltemplate>                     <rectangle stroke="red" strokethickness="1" margin="-2"/>                 </controltemplate>             </setter.value>         </setter>     </style> </window.resources>  <button x:name="button" content="button" horizontalalignment="center" verticalalignment="center" width="75" focusvisualstyle="{dynamicresource myfocusvisualstyle}"/>  
 
  
Comments
Post a Comment