Car*_*pon 8 .net c# silverlight silverlight-4.0
如何设置文本框的宽度以编程方式填充容器?例如,如果我对文本框有以下声明,则在xaml中:
<TextBox Height="23" Name="TextBox1" VerticalAlignment="Top" Width="50" />
Run Code Online (Sandbox Code Playgroud)
如何设置宽度,使其在按钮单击处理程序中填充容器?
Mar*_*ter 18
您应该能够使用HorizontalAlignment="Stretch"(确保您没有设置显式Width或MaxWidth允许动态调整大小).我没有做任何Sliverlight开发,但在WPF中,这就是诀窍!