在Windows 8手机的组合框 [英] Combo box in windows phone 8
问题描述
<ComboBox x:Name="c1" Margin="21,134,228,-184" BorderBrush="{x:Null}" BorderThickness="6" Background="{x:Null}" Foreground="#FFFF0017" />
List<String> source = new List<String>();
c1.ItemsSource = source;
c1.SelectedIndex = 0;
我能看到的物品,但我不能选择它们?我不能滚动?就像我比组合框的大小,添加更多的,
I can see the items but I can't select them? and I can't scroll??? like when I add more than the size of the combo box,
应该出现滚动?我是从Windows应用商店的C#来了,那就是它在那边的方式。
it should appear a scroll? I'm coming from windows store c# and that is the way it is over there.
我想它做它只是作为一个普通的ComboBox工作,你点击它,它就会出现,你可以选择...谢谢项目的滚动列表!
I want it to make it work just as a regular combobox, you click on it and it will appear a scrollable list of items that you can select... Thanks!
推荐答案
这是不建议使用组合框控制。 。使用ListPicker控制
It is not recommended to use combobox control. Use the ListPicker Control.
步骤:
-
下载的NuGet包从这个链接: https://www.nuget.org/packages/WPtoolkit/
添加到您的XAML文件的顶部有一个参考:
Add a reference to the top of your xaml file :
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
$如下图所示的b $ b
使用ListPicker:
Use ListPicker as shown below :
<toolkit:ListPicker Height="50" ScrollViewer.VerticalScrollBarVisibility="Auto" ItemsSource="{Binding ElementName=ConverterPage, Path=Locations}" Margin="179,129,70,434" Name="cmbCurrFrom">
<toolkit:ListPicker.ItemTemplate>
<DataTemplate>
<TextBlock FontSize="30" Foreground="Black" Text="{Binding Path=Location}"></TextBlock>
</DataTemplate>
</toolkit:ListPicker.ItemTemplate>
<toolkit:ListPicker.FullModeItemTemplate>
<DataTemplate>
<TextBlock FontSize="30" Foreground="Black" Text="{Binding Path=Location}"></TextBlock>
</DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>
</toolkit:ListPicker>
这篇关于在Windows 8手机的组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!