Ich habe eine Ansicht, die Informationen anzeigen und testen sollte, fügte ich testdata hinzu. Wenn ich jedoch zu viele Elemente für den Bildschirmbereich hinzufüge, wird die vertikale Bildlaufleiste nicht angezeigt.ListBox Vertikale Bildlaufleiste wird nicht angezeigt (WPF)
Das ist mein XML-Code:
<UserControl x:Class="not relevant"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="not relevant"
mc:Ignorable="d"
Width="250">
<Border Background="{DynamicResource BG}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<StackPanel>
<Grid>
<Label Height="30" Content="Geöffnete Designs" HorizontalContentAlignment="Center"></Label>
<Separator Background="DarkGray"/>
<ListBox Background="{DynamicResource BG}" BorderThickness="0" VerticalAlignment="Stretch" >
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
</ListBox>
</Grid>
</StackPanel>
</Border>
Ich habe versucht, einen Scroll-Viewer anstatt das Hinzufügen, aber das funktioniert nicht richtig. Mache ich etwas falsch oder was könnte ich das Problem?
ziemlich neu in WPF. Vielen Dank für die weitere Erklärung in Ihrer Bearbeitung. Sollte wahrscheinlich ein Buch anstelle von Tutorials lesen, die nur Code ohne weitere Erklärung zeigen – fbueckle
Ihre Begrüßung, wir alle begannen einmal :) Viel Glück beim Lernen WPF –