c# - MenuItem Vertical alignment issue -
i facing issue menuitem whenever specify access key, header alignment getting disrupted. below sample image wherein have specified "_new" new menu item , bound new command. can observe tha text "new" align @ bottom , shortcut key aligned @ top. other menu items have not specified access key, have no issue.
here xaml
<stackpanel dockpanel.dock="top"> <menu padding="0,5"> <menuitem x:name="mnutask" header="task"> <menuitem x:name="mnunew" header="_new" command="new"/> <menuitem x:name="mnusave" header="save" command="save"/> <menuitem x:name="mnudelete" header="delete" command="delete"/> <separator/> <menuitem x:name="mnurefresh" header="reload data" command="{x:static local:mainwindow.refreshdatacommand}" /> <menuitem x:name="mnuhistory" header="view range history" command="{x:static local:mainwindow.rangehistorycommand}" /> <separator/> <menuitem x:name="mnuexit" header="exit" command="close"/> </menuitem> <menuitem x:name="mnuview" header="view"> <menuitem x:name="mnufind" header="find formula"/> </menuitem> </menu> </stackpanel>
could body let me know what's going on?
found it. had below textblock style present in resources section of window. commenting lines resolved issue. (but need apply textblock style explicitly using keys :( )
<style targettype="textblock"> <setter property="margin" value="3,6,3,0"/> <setter property="verticalalignment" value="bottom"/> </style>
Comments
Post a Comment