2011-06-12 31 views
0
<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"> 

如何在運行時在代碼內更改此設計寬度?如何更改代碼內窗口的寬度?

回答

3

設計的寬度和高度都設計不運行時

改變窗口的寬度和高度只需使用 this.Width和this.Height

+0

這是我想的第一件事情,並沒有與工作d:DesignWidth – dandvto 2011-06-12 16:12:06

+0

您無法更改d:DesignWidth,因爲它是針對設計時間的 – 2011-06-12 16:13:13

+0

所有內容都可以更改,我懷疑有些東西無法完成 – dandvto 2011-06-12 16:14:20