簡體   English   中英

列表框沒有獲得垂直滾動條

[英]Listbox is not getting a vertical scrollbar

人們似乎對垂直滾動條沒有出現的主要問題是因為他們使用堆棧面板。 我經歷了完整的可視化樹,並且列表框不在任何地方的堆棧面板中。

這是我使用的XAML:

<Grid>
    <Grid.Resources>
        <local:ReportToListItem x:Key="reportToListItem" />
    </Grid.Resources>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="3" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <ListBox Background="PaleGoldenrod" x:Name="Controller_Domain_Reports_OpenReports">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <ContentControl cal:View.Model="{Binding Converter={StaticResource reportToListItem}}"/>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
    <Border Grid.Row="1" Background="Black" Height="3" HorizontalAlignment="Stretch" />
    <ListBox Background="Magenta" Grid.Row="2" x:Name="Controller_Domain_Reports_ClosedReports">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <ContentControl cal:View.Model="{Binding Converter={StaticResource reportToListItem}}"/>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</Grid>

如果列表框超出了我對窗口的高度,則兩個列表框都不會獲得滾動條。 我在俯視什么?

只需將其正確關閉即可:

是的。shellview有一個很好的復制粘貼的rowdefinitions列表,所有這些都設置為auto。 將包含該視圖的視圖更改為*,現在可以正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM