c# - IsDefault causes focus instead of click -


i have control 3 text boxes , 1 button set isdefault. when typing in 1 of text boxes , press enter key expect isdefault button clicked, instead focuses button instead of clicking it. have made sure there no other isdefault buttons, have checked isdefaulted property of button true when press enter button.

<grid dockpanel.dock="top">     <grid.rowdefinitions>         <rowdefinition height="30"/>         <rowdefinition height="30"/>         <rowdefinition height="30"/>         <rowdefinition/>     </grid.rowdefinitions>      <grid.columndefinitions>         <columndefinition/>         <columndefinition/>     </grid.columndefinitions>      <textblock text="new:" verticalalignment="center" margin="5,0,0,0" grid.column="0"/>     <textbox undolimit="10" name="txtaddnew" grid.column="1" height="23" margin="10,0" verticalalignment="center"/>      <textblock text="amendment:" verticalalignment="center" margin="5,0,0,0" grid.column="0" grid.row="1"/>     <textbox undolimit="10" name="txtaddamend" grid.column="1" height="23" margin="10,0" verticalalignment="center" grid.row="1"/>      <textblock text="unknown:" verticalalignment="center" margin="5,0,0,0" grid.column="0" grid.row="2"/>     <textbox undolimit="10" name="txtaddunknown" grid.column="1" height="23" margin="10,0" verticalalignment="center" grid.row="2"/>      <idyllic:idyllicbutton dockpanel.dock="top" margin="10,5" isdefault="true" name="btnadd" height="30" grid.row="3" grid.columnspan="2">         <stackpanel>             <idyllic:customfillimage image="{staticresource add}" fill="{binding relativesource={relativesource ancestortype=button}, path=foreground}"/>         </stackpanel>     </idyllic:idyllicbutton> </grid> 

enter image description here

edit: proposed question duplication not fix issue, not want set focus of button, issue. when press enter button focused instead of clicked. button set isdefault.

i found issue, problem there user control embedded in control implements isdefault, suppose in case behavior focus first isdefault button on page, including child user controls.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -