开发者

problem wpf program in diffrent resolution

开发者 https://www.devze.com 2023-03-08 23:44 出处:网络
I have written a program with WPF but in low resolution it has problem what shall i do 开发者_如何学Pythonthat this program will be OK in every resolutionI am guessing that the problem you have is, t

I have written a program with WPF but in low resolution it has problem

what shall i do 开发者_如何学Pythonthat this program will be OK in every resolution


I am guessing that the problem you have is, that your application does not fit on the screen. What I normally do in this case, is placing the entire application inside a ViewBox and set the Window size to something dynamic (i.e. WindowState.Maximized)

Loos like

<Windows .....>
    <ViewBox Stretch="Uniform">
        <!-- Put all other UI stuff here. -->
    </ViewBox>
</Window>


You have to make a decision: What do you want the application to do with the extra (or less) screen space?

Basically there are 3 options:

  1. Scale everything according to the available screen space. (ViewBox is a good option here)

  2. Size and position controls according to available screen space. (Margins and NO hard coded sizes are the way to go)

  3. Combine #1 and #2 (more complex but might help you to utilize the available space the best)

You need to give us more information if you want more details help.

0

精彩评论

暂无评论...
验证码 换一张
取 消