2010-11-28 81 views
0

我正在製作一個UNO遊戲應用程序。我很方便地創建了一個form2(遊戲桌),所有玩家和他們的卡片都被顯示出來。現在,我只想添加一個文本框來顯示當前玩家。Windows窗體應用程序C銳視覺工作室2010

所以我所做的就是 -

  1. 拖放一個文本框。 警告 - 警告1您必須重建您的項目,才能對Gui1.Form2所做的更改顯示在任何開放式設計器中。 0 0

  2. 重建DA形式 -

我看到另一個文件被創建 - form21.designer.cs。 PL。請參閱以下文件的內容 -

錯誤 - 錯誤1缺少對'Gui1.Form2'類型聲明的部分修飾符;此類型的另一個部分聲明存在C:\ Users \ uday \ Desktop \ Uday \ Client_0407 \ Gui1 \ Form21.Designer.cs 25 18 Gui1

注 - 它不僅僅用於文本框。如果我做了任何拖放修改,則會發生同樣的情況。

form21.designer.cs

//------------------------------------------------------------------------------ 
// <auto-generated> 
//  This code was generated by a tool. 
//  Runtime Version:4.0.30319.1 
// 
//  Changes to this file may cause incorrect behavior and will be lost if 
//  the code is regenerated. 
// </auto-generated> 
//------------------------------------------------------------------------------ 

namespace Gui1 { 
    using System; 


    /// <summary> 
    /// A strongly-typed resource class, for looking up localized strings, etc. 
    /// </summary> 
    // This class was auto-generated by the StronglyTypedResourceBuilder 
    // class via a tool like ResGen or Visual Studio. 
    // To add or remove a member, edit your .ResX file then rerun ResGen 
    // with the /str option, or rebuild your VS project. 
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 
    public class Form2 { 

     private static global::System.Resources.ResourceManager resourceMan; 

     private static global::System.Globalization.CultureInfo resourceCulture; 

     [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 
     internal Form2() { 
     } 

     /// <summary> 
     /// Returns the cached ResourceManager instance used by this class. 
     /// </summary> 
     [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 
     public static global::System.Resources.ResourceManager ResourceManager { 
      get { 
       if (object.ReferenceEquals(resourceMan, null)) { 
        global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Gui1.Form2", typeof(Form2).Assembly); 
        resourceMan = temp; 
       } 
       return resourceMan; 
      } 
     } 

     /// <summary> 
     /// Overrides the current thread's CurrentUICulture property for all 
     /// resource lookups using this strongly typed resource class. 
     /// </summary> 
     [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 
     public static global::System.Globalization.CultureInfo Culture { 
      get { 
       return resourceCulture; 
      } 
      set { 
       resourceCulture = value; 
      } 
     } 

     public static System.Drawing.Bitmap Pic_MyPlayer_Image { 
      get { 
       object obj = ResourceManager.GetObject("Pic_MyPlayer.Image", resourceCulture); 
       return ((System.Drawing.Bitmap)(obj)); 
      } 
     } 

     public static System.Drawing.Bitmap Pic_OtherPlayer1_Image { 
      get { 
       object obj = ResourceManager.GetObject("Pic_OtherPlayer1.Image", resourceCulture); 
       return ((System.Drawing.Bitmap)(obj)); 
      } 
     } 

     public static System.Drawing.Bitmap Pic_OtherPlayer2_Image { 
      get { 
       object obj = ResourceManager.GetObject("Pic_OtherPlayer2.Image", resourceCulture); 
       return ((System.Drawing.Bitmap)(obj)); 
      } 
     } 

     public static System.Drawing.Bitmap Pic_OtherPlayer3_Image { 
      get { 
       object obj = ResourceManager.GetObject("Pic_OtherPlayer3.Image", resourceCulture); 
       return ((System.Drawing.Bitmap)(obj)); 
      } 
     } 
    } 
} 
+0

哇,太棒了。快速,在爆炸之前將其關閉! – 2010-11-28 21:56:09

回答

2

你的文件被搞砸了;它看起來像試圖將一半的資源類轉換成一個表單。

通過右鍵單擊該項目並單擊添加Windows窗體(併爲其指定一個真實姓名而不是Form2)並將代碼移入其中。
然後,刪除當前功能失常的Form2中涉及的所有文件。