.net - How to Customize window title Extended,Gradient -
window x:class="wpf_ui.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mian window" windowstyle="none" allowstransparency="true" width="775" height="500"
i have customize window title extended,gradient.how should in wpf.
i have make window appearance abv image
try this overwrite stackpanel on window tilte bar. make windowstyle="none" resizemode="noresize" , adjust margin of controls(make top negative of stackpanel) overwrite window stackpanel on title bar.
<window x:class="wpf_ui.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" windowstyle="none" windowstartuplocation="centerscreen" resizemode="noresize" width="920" height="600" > <grid>....other stack panels.... **here have take stack panel overwrite on window title bar.** <stackpanel margin="0,-566,0,5" grid.columnspan="3" height="25" datacontext="{binding}"> <stackpanel.background> <lineargradientbrush> <gradientstop color="white" offset=".2" /> <gradientstop color="gray" offset=".5" /> <gradientstop color="black" offset="1" /> </lineargradientbrush> </stackpanel.background> <textblock horizontalalignment="left" verticalalignment="center" margin="1,5,0,0"> application name </textblock> <button content="close" margin="860,-17,0,0" verticalalignment="center" horizontalalignment="left" name="btnclose" width="40" > <button.background> <lineargradientbrush startpoint="0,0" endpoint="0,2"> <gradientstop color="black" offset=".2" /> <gradientstop color="gray" offset=".5" /> <gradientstop color="white" offset="1" /> </lineargradientbrush> </button.background> </button> </stackpanel> </grid>
Comments
Post a Comment