problem0 Login to vote
The interface layout is by default 1920*1080 resolution layout, now want to automatically adapt to different resolutions of the screen.
such as TextBlock width 100 high 40 text is 20px
Adapt to the resolution for 1600*900, what to do to make TextBlock look unchanged
Thank you May 7, 2014 2:46 reply | Quote Answer 1 login to vote
Can you consider view Box? As long as the fixed value of the design layout, put in a fixed-width canvas/grid, and then put into the viewbox, you can ensure that all of your control a wide scale unchanged.
Changing the size of the window, the controls inside will adapt to change.
<window x:class= "Wpfapplication4.mainwindow"
xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/ Presentation "
xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "
title=" MainWindow "height=" "350" Width= "525" >
<Viewbox>
<canvas height= "1080" width= "1920" >
<textblock text= " Something "canvas.left=" 900 "canvas.top=" fontsize= ""/>
</Canvas>
</Viewbox>
</Window>
Http://msdn.microsoft.com/en-us/library/system.windows.controls.viewbox.aspx
Edited Myyvictor May 21, 2014 3:27 has been marked as an answer Jimmy-yangMicrosoft contingent staff, moderator May 22, 2014 9:02 May 21, 2014 3:20 reply | Reference