【发布时间】:2012-05-26 03:55:16
【问题描述】:
到目前为止,Listpickeritem 似乎有点让人头疼,因为它很容易崩溃。
我有以下代码在运行应用程序时选择 listpickeritem 时崩溃:
for (int i = 1; i <= 100; i++)
{
ListPickerItem item = new ListPickerItem();
item.Content = i.ToString() + "%";
item.FontSize = 35;
listPicker1.Items.Add(item);
}
XAML:
<toolkit:ListPicker Name="listPicker1" Margin="251,117,92,-93" Width="113" FontSize="40">
</toolkit:ListPicker>
有谁知道通过 c# 设置字体大小而不会崩溃的方法?如果我手动输入 xaml,这也会导致崩溃,并且我不想在可以通过编程方式执行时输入长列表。
编辑下面的答案。
最初出现的错误消息:未处理的异常 ">PivotApp1.App.Application_UnhandledException(object sender, System.Windows.ApplicationUnhandledExceptionEventArgs e) Line 125 + 0x5 bytes C#"
【问题讨论】:
-
“崩溃”是什么意思?当它在您的代码中到达这一点时究竟会发生什么?
-
一旦选择了列表选择器,就会出现未处理的异常。 ">PivotApp1.dll!PivotApp1.App.Application_UnhandledException(object sender, System.Windows.ApplicationUnhandledExceptionEventArgs e) Line 125 + 0x5 bytes C#"
-
异常的message属性说明了什么?
-
我已经解决了这个问题,感谢您的帮助。我很感激。在下面回答。
标签: c# windows-phone-7 silverlight-4.0 crash listpicker