|
Dieser Artikel wurde maschinell übersetzt. Bewegen Sie den Mauszeiger über die Sätze im Artikel, um den Originaltext anzuzeigen. Weitere Informationen
|
Übersetzung
Original
|
FrameworkElement.Height-Eigenschaft
Namespace: System.Windows
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS für XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
[TypeConverterAttribute(typeof(LengthConverter))] [LocalizabilityAttribute(LocalizationCategory.None, Readability = Readability.Unreadable)] public double Height { get; set; }
<object Height="double"/> - or - <object Height="qualifiedDouble"/> - or - <object Height="Auto"/>
XAML-Werte
Eigenschaftswert
Typ: System.Double<Canvas Height="200" MinWidth="200" Background="#b0c4de" VerticalAlignment="Top" HorizontalAlignment="Center" Name="myCanvas" Margin="0,0,0,50"> <Rectangle HorizontalAlignment="Center" Canvas.Top="50" Canvas.Left="50" Name="rect1" Fill="#4682b4" Height="100" Width="100"/> </Canvas> ... <TextBlock Grid.Row="1" Grid.Column="0" Margin="10,0,0,0" TextWrapping="Wrap">Set the Rectangle Height:</TextBlock> <ListBox Grid.Column="1" Grid.Row="1" Margin="10,0,0,0" Height="50" Width="50" SelectionChanged="changeHeight"> <ListBoxItem>25</ListBoxItem> <ListBoxItem>50</ListBoxItem> <ListBoxItem>75</ListBoxItem> <ListBoxItem>100</ListBoxItem> <ListBoxItem>125</ListBoxItem> <ListBoxItem>150</ListBoxItem> <ListBoxItem>175</ListBoxItem> <ListBoxItem>200</ListBoxItem> </ListBox> <TextBlock Grid.Row="1" Grid.Column="2" Margin="10,0,0,0" TextWrapping="Wrap">Set the Rectangle MinHeight:</TextBlock> <ListBox Grid.Column="3" Grid.Row="1" Margin="10,0,0,0" Height="50" Width="50" SelectionChanged="changeMinHeight"> <ListBoxItem>25</ListBoxItem> <ListBoxItem>50</ListBoxItem> <ListBoxItem>75</ListBoxItem> <ListBoxItem>100</ListBoxItem> <ListBoxItem>125</ListBoxItem> <ListBoxItem>150</ListBoxItem> <ListBoxItem>175</ListBoxItem> <ListBoxItem>200</ListBoxItem> </ListBox> <TextBlock Grid.Row="1" Grid.Column="4" Margin="10,0,0,0" TextWrapping="Wrap">Set the Rectangle MaxHeight:</TextBlock> <ListBox Grid.Column="5" Grid.Row="1" Margin="10,0,0,0" Height="50" Width="50" SelectionChanged="changeMaxHeight"> <ListBoxItem>25</ListBoxItem> <ListBoxItem>50</ListBoxItem> <ListBoxItem>75</ListBoxItem> <ListBoxItem>100</ListBoxItem> <ListBoxItem>125</ListBoxItem> <ListBoxItem>150</ListBoxItem> <ListBoxItem>175</ListBoxItem> <ListBoxItem>200</ListBoxItem> </ListBox>
private void changeHeight(object sender, SelectionChangedEventArgs args) { ListBoxItem li = ((sender as ListBox).SelectedItem as ListBoxItem); Double sz1 = Double.Parse(li.Content.ToString()); rect1.Height = sz1; rect1.UpdateLayout(); txt1.Text= "ActualHeight is set to " + rect1.ActualHeight; txt2.Text= "Height is set to " + rect1.Height; txt3.Text= "MinHeight is set to " + rect1.MinHeight; txt4.Text= "MaxHeight is set to " + rect1.MaxHeight; } private void changeMinHeight(object sender, SelectionChangedEventArgs args) { ListBoxItem li = ((sender as ListBox).SelectedItem as ListBoxItem); Double sz1 = Double.Parse(li.Content.ToString()); rect1.MinHeight = sz1; rect1.UpdateLayout(); txt1.Text= "ActualHeight is set to " + rect1.ActualHeight; txt2.Text= "Height is set to " + rect1.Height; txt3.Text= "MinHeight is set to " + rect1.MinHeight; txt4.Text= "MaxHeight is set to " + rect1.MaxHeight; } private void changeMaxHeight(object sender, SelectionChangedEventArgs args) { ListBoxItem li = ((sender as ListBox).SelectedItem as ListBoxItem); Double sz1 = Double.Parse(li.Content.ToString()); rect1.MaxHeight = sz1; rect1.UpdateLayout(); txt1.Text= "ActualHeight is set to " + rect1.ActualHeight; txt2.Text= "Height is set to " + rect1.Height; txt3.Text= "MinHeight is set to " + rect1.MinHeight; txt4.Text= "MaxHeight is set to " + rect1.MaxHeight; }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.