2010-11-28 73 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中涉及的所有文件。