1

フォームに Button2 コントロールがあります。名前の変更に問題があります:

プロパティ値が無効です

また

プロパティ 'BackgroundImage' のコード生成に失敗しました

Button2 コントロールのその他のプロパティ:

Button2 コントロールのその他のプロパティ

どうすればこの問題を解決できますか?

前述したように、プロジェクトの DesignTimeAttributes.xmtaファイルに Build Action: None を追加する必要がありますか?

.NET Compact Framework 3.5/Visual Studio 2008/OpenNETCF Smart Device Framework 2.3 ライブラリ (Community Edition) を使用しています

4

1 に答える 1

1

私も同じ問題を抱えていました。コンストラクターですべての初期化コード (InitializeComponent の呼び出し以外) を削除しましたが、まだこの問題がありました。次の内容の DesignTimeAttributes.xmta ファイルを追加することで、この問題を解決できました。

<Class Name="OpenNETCF.Widows.Forms.Button2">
    <DesktopCompatible>true</DesktopCompatible>
    <DesignTimeVisible>true</DesignTimeVisible>
    <Property Name="BackgroundImage">
      <Category>Misc</Category>
      <DefaultValue>
        <Type>System.Drawing.Image, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Type>
      </DefaultValue>
      <Description>The background image displayed for the control.</Description>
    </Property>
  </Class>
于 2014-04-15T11:55:49.607 に答える