c# - Visual Studio 2010 SP1 design time renders differently than runtime -



c# - Visual Studio 2010 SP1 design time renders differently than runtime -

i have simple wpf window in format of:

<window> <canvas> <grid> <listbox /> </grid> </canvas> </window>

at design time looks way want it. there no automatic resizing on of window controls. @ runtime window has white space @ bottom , right side.

if open solution in visual 2013 can see white space in designer.

has ever come across this? cant find online or fixes released microsoft.

if alter window size borders smaller controls in looks fine @ run time. if open project in 2013 designer looks fine. controls within borders.

note: im stuck using 2010 that's bulk of our projects designed in. im new wpf.

full xaml:

<window x:class="manageclosedchecks.closedchecklist" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" windowstyle="none" title="" height="461" width="772" topmost="true" showintaskbar="false" name="window" resizemode="noresize" windowstartuplocation="centerowner" loaded="window_loaded" allowstransparency="true" borderbrush="black" borderthickness="3"> <window.resources> <style x:key="{x:type scrollbar}" targettype="{x:type scrollbar}"> <setter property="minwidth" value="75" /> <setter property="width" value="75" /> </style> </window.resources> <canvas height="461" horizontalalignment="left" margin="0,0,0,0" name="canvas1" verticalalignment="top" width="746"> <grid height="458" width="746" background="transparent" canvas.top="0"> <button content="reprint" height="41" horizontalalignment="left" margin="14,411,0,0" name="reprintbtn" verticalalignment="top" width="109" click="reprintbtn_click" isenabled="false" /> <button content="adjust" height="41" horizontalalignment="left" margin="143,411,0,0" name="adjustbtn" verticalalignment="top" width="109" click="adjustbtn_click" isenabled="false" /> <button content="cancel" height="41" horizontalalignment="right" margin="0,411,91,0" name="cancelbtn" verticalalignment="top" width="109" click="cancelbtn_click" /> <button content="re-open" height="41" horizontalalignment="left" isenabled="false" margin="413,411,0,0" name="reopenbtn" verticalalignment="top" width="109" click="reopenbtn_click" /> <button content="void" height="41" horizontalalignment="right" isenabled="false" margin="0,411,354,0" name="voidbtn" verticalalignment="top" width="109" click="voidbtn_click" /> <button fontfamily="marlett" fontsize="70" content="5" height="186" horizontalalignment="left" margin="661,45,0,0" name="upbtn" verticalalignment="top" width="85" click="upbtn_click" /> <button fontfamily="marlett" fontsize="70" content="6" height="175" horizontalalignment="left" margin="661,0,0,50" name="downbtn" verticalalignment="bottom" width="85" click="downbtn_click" /> <listview scrollviewer.verticalscrollbarvisibility="visible" height="363" horizontalalignment="left" name="listview1" verticalalignment="top" width="659" fontsize="18" horizontalcontentalignment="left" selectionmode="single" margin="0,45,0,0"> <listview.view> <gridview allowscolumnreorder="false"> <gridviewcolumn width="auto" displaymemberbinding="{binding checknum}" > <gridviewcolumn.header> <gridviewcolumnheader tag="checknum" click="lvuserscolumnheader_click">check</gridviewcolumnheader> </gridviewcolumn.header> </gridviewcolumn> <gridviewcolumn width="auto" displaymemberbinding="{binding closeddatetime, stringformat={}{0:yyyy-mm-dd hh:mm:ss}}"> <gridviewcolumn.header> <gridviewcolumnheader tag="closeddatetime" click="lvuserscolumnheader_click">closed date time</gridviewcolumnheader> </gridviewcolumn.header> </gridviewcolumn> <gridviewcolumn width="auto" displaymemberbinding="{binding checkid}"> <gridviewcolumn.header> <gridviewcolumnheader tag="checkid" click="lvuserscolumnheader_click">check id</gridviewcolumnheader> </gridviewcolumn.header> </gridviewcolumn> <gridviewcolumn width="auto" displaymemberbinding="{binding amount}"> <gridviewcolumn.header> <gridviewcolumnheader tag="amount" click="lvuserscolumnheader_click">amount</gridviewcolumnheader> </gridviewcolumn.header> </gridviewcolumn> <gridviewcolumn width="auto" displaymemberbinding="{binding employee}"> <gridviewcolumn.header> <gridviewcolumnheader tag="employee" click="lvuserscolumnheader_click">employee</gridviewcolumnheader> </gridviewcolumn.header> </gridviewcolumn> <gridviewcolumn width="auto" displaymemberbinding="{binding tablenum}"> <gridviewcolumn.header> <gridviewcolumnheader tag="tablenum" click="lvuserscolumnheader_click">table</gridviewcolumnheader> </gridviewcolumn.header> </gridviewcolumn> </gridview> </listview.view> </listview> </grid> </canvas> </window>

set sizetocontent property of window , remove manually given width , height properties of window.

sizetocontent="widthandheight"

remove height="461" width="772">

then looks like:

design window in vs2010:

runtime:

c# wpf visual-studio-2010 visual-studio-2013 designer

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -