开发者

problem wpf program in diffrent resolution

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜