简体   繁体   中英

White border appearing above window in WPF designer

When using the designer in Visual Studio, a white bar appears at the top. I am unable to put any content in this bar as anything that goes near it goes underneath it.

http://i.imgur.com/tqp59.png

This causes a black bar to appear where I can't place content and it is making it impossible to design the window, because all of the locations change from designer to run-time.

The white bar at the top is to allow room for the Window Bar. You can change the black gap at the top of the application by changing the margin of the grid that surrounds all the controls:

<Grid Margin="0,-10,0,0">

</Grid>

Where Margin="left,up,right,down" so Margin="0,-10,0,0" will move the whole grid margin up 10 more pixels, so you can add anything you want into that extra space up the top. This should also get rid of your black bar issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM