[英]Windows Form Application C sharp visual studio 2010
I am making an UNO game application. 我正在制作一个UNO游戏应用程序。 I conveniently created a form2 (game table) with all the players and their cards being displayed etc. Now, I just want to add a text box to show the current player.
我方便地创建了一个form2(游戏桌),其中显示了所有玩家及其卡牌,等等。现在,我只想添加一个文本框来显示当前玩家。
So what i did was - 所以我做的是 -
Dragged and dropped a text box. 拖曳并放下一个文本框。 Warning - Warning 1 You must rebuild your project for the changes to Gui1.Form2 to show up in any open designers.
警告-警告1您必须重建项目才能对Gui1.Form2所做的更改显示在任何打开的设计器中。 0 0
0 0
Rebuild da form - 重建da形式 -
I see another file being created - form21.designer.cs. 我看到正在创建另一个文件-form21.designer.cs。 Pl.
PL。 see the contents of file below -
请参阅以下文件的内容-
Error - Error 1 Missing partial modifier on declaration of type 'Gui1.Form2'; 错误 - 错误1在声明类型'Gui1.Form2'时缺少部分修饰符; another partial declaration of this type exists C:\\Users\\uday\\Desktop\\Uday\\Client_0407\\Gui1\\Form21.Designer.cs 25 18 Gui1
存在此类型的另一个部分声明C:\\ Users \\ uday \\ Desktop \\ Uday \\ Client_0407 \\ Gui1 \\ Form21.Designer.cs 25 18 Gui1
NOTE - It is not just with textbox only. 注意 - 它不仅仅是文本框。 If I do any drag and drop modifications, same happens.
如果我做任何拖放修改,同样的事情发生。
form21.designer.cs 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));
}
}
}
}
Your files are messed up; 你的文件搞砸了; it looks like to tried to convert half of a Resources class into a form.
它似乎试图将Resources类的一半转换为表单。
Add a new Form by right-clicking the project and clicking Add, Windows Form (and give it an real name, not Form2
) and move your code into it. 右键单击项目,然后单击“添加”,“ Windows窗体”(并为其提供真实名称, 而不是“
Form2
),然后将代码移入其中,以添加新窗体。
Then, delete all of the files involved in your current dysfunctional Form2. 然后,删除当前功能不正常的Form2中涉及的所有文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.