0

我正在做这个 Windows Phone 应用程序示例,在堆栈面板中创建一个列表框后一切正常。但过了一段时间我得到这个错误:

在此处输入图像描述

下面是我在 stackpanel 中创建的列表框的代码:

<ListBox Margin="0,0,-12,0"
         Name="listBox1">
  <StackPanel Orientation="Horizontal"
              Margin="0,0,17,0">
    <Image Source="icons/star.png"
           Height="100"
           Width="100"
           Margin="12,0,9,0">
    </Image>
    <StackPanel Width="311">
      <TextBlock Text="Folders"
                 TextWrapping="Wrap"
                 Style="{StaticResource PhoneTextExtraLargeStyle}" />
      <TextBlock Text="my personal images"
                 TextWrapping="Wrap"
                 Margin="12,-6,12,0,"
                 Style="{StaticResource PhoneTextSubtleStyle}" />
    </StackPanel>
</ListBox>

为什么我会收到此错误?

4

2 回答 2

2

According to the error message, you're trying to set 12,-6,12,0, as a thickness (probably a margin or a padding). Remove the trailing comma and it should work: 12,-6,12,0

于 2012-11-30T12:41:52.323 回答
0

你似乎有标签

<StackPanel>

打开了两次,你只关闭了其中一个

于 2012-11-30T15:05:57.120 回答