如何在特定宽度下,获得自适应高度【WPF】

 

double ScreenWidth, ScreenHeight, WindowWidth, WindowHeight;

ScreenWidth 
= SystemParameters.PrimaryScreenWidth;

ScreenHeight 
= SystemParameters.PrimaryScreenHeight;

WindowWidth 
= 800;

WindowHeight 
= ScreenHeight * WindowWidth / ScreenWidth; //根据屏幕分辨率计算出窗口模式下高度
posted @ 2011-09-05 09:50  海底的鱼  阅读(873)  评论(0)    收藏  举报