如何解决如何更改代码内的窗口宽度?
|<Window x:Class=\"WpfApplication1.MainWindow\"
xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"
xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"
Title=\"MainWindow\" Name=\"W_win_rp\" Background=\"Bisque\" mc:Ignorable=\"d\" xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" d:DesignHeight=\"350\" d:DesignWidth=\"525\" SizeToContent=\"WidthAndHeight\">
如何在运行时在代码中更改此designwidth?
解决方法
设计宽度和高度是为设计而不是运行时设计的
用于更改窗口的宽度和高度,只需使用
this.Width和this.Height
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。