组合框windows phone 8 dev [英] Combo Boxes windows phone 8 dev
问题描述
< ComboBox x:Name =" c1"余量= QUOT; 21134228,-184" BorderBrush = QUOT; {X:空}"了borderThickness = QUOT; 6英寸背景= QUOT; {X:空}"前景= QUOT;#FFFF0017" />
List< String> source = new List< String>();
c1.ItemsSource = source;
c1.SelectedIndex = 0;
我可以看到这些物品,但我无法选择它们?我不能滚动???比如当我添加超过组合框的大小时,
它应该显示为滚动?我来自windows store c#,这就是那边的方式。
我希望它能像普通的组合框一样工作,你点击它就会出现您
的可滚动项目列表可以选择...谢谢!
In windows phone 8没有组合框控件。您可以使用工具包ListPicker而不是组合框。它是Windows Phone应用程序的标准 这里是在windows phone中添加listpicker的代码示例
< toolkit:ListPicker Margin =" 5,35, 0,0"宽度= QUOT; 450"字号= QUOT; 21" Grid.Row = QUOT 1 QUOT; Grid.Column = QUOT; 0"
ItemsSource =" {Binding MyList}"
DisplayMemberPath =" Value"
SelectedItem =" {Binding MySelected,ItemMode = TwoWay}" />希望这会有所帮助
<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 selected them? and I can't scroll??? like when I add more than the size of the combo box,
it should appear a scroll? I'm coming from windows store c# and that is the way it is over there.
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!
In windows phone 8 there is no combo box control. you can use toolkit ListPicker instead of combo box. it is the standard for windows phone applications here is the code sample for adding listpicker in windows phone
<toolkit:ListPicker Margin="5,35,0,0" Width="450" FontSize="21" Grid.Row="1" Grid.Column="0" ItemsSource="{Binding MyList}" DisplayMemberPath="Value" SelectedItem="{Binding MySelected, ItemMode=TwoWay}"/>Hope this will help
这篇关于组合框windows phone 8 dev的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!