0
在下面的XAML中,組合框不可見。我究竟做錯了什麼?如果放置多個面板,Combobox不可見
<Grid>
<StackPanel>
<ComboBox Name="combo1"
ItemsSource="{Binding}"
DisplayMemberPath="PartNumber" />
</StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0"
Grid.Column="0"
Text="{Binding ElementName=combo1, Path=SelectedItem.PartName}"
Background="AliceBlue" />
<TextBlock Grid.Row="0"
Grid.Column="1"
Text="{Binding ElementName=combo1, Path=SelectedItem.PartQuantity}"
Background="Beige" />
</Grid>
</Grid>
您將第二個網格(包含2個文本塊的網格)放置在帶有組合框的堆棧面板的前面(表示更高的Z順序)。你想實現什麼?請具體說明,我們可以給你一個更好的解決方案 –