gpt4 book ai didi

c# - 表单和设计器文件未在解决方案资源管理器中链接

转载 作者:IT王子 更新时间:2023-10-29 04:53:52 28 4
gpt4 key购买 nike

我似乎无法将表单和设计器文件链接到我的项目中。它们在解决方案资源管理器中看起来像这样。

enter image description here

我已将文件从项目中排除,然后尝试将它们包括回项目中,但这没有用。下面是设计器代码和表单代码片段,以防其中有内容。

public partial class FormPrompt
{
private Button ButtonOk;
private Container Components;
private Label LabelPleaseEnter;
private Label LabelPrompt;
private TextBox TextBoxData;

private void InitializeComponent()
{
this.LabelPleaseEnter = new Label();
this.LabelPrompt = new Label();
this.TextBoxData = new TextBox();
this.ButtonOk = new Button();
this.LabelPleaseEnter.Location = new Point(8, 0x58);
this.LabelPleaseEnter.Size = new Size(0x48, 0x10);
this.LabelPleaseEnter.Text = "Please enter";
this.LabelPrompt.Location = new Point(80, 0x58);
this.LabelPrompt.Size = new Size(0x98, 0x10);
this.LabelPrompt.Text = "LabelPrompt";
this.TextBoxData.Location = new Point(8, 0x80);
this.TextBoxData.Size = new Size(0xe0, 20);
this.TextBoxData.Text = "TextBoxData";
this.TextBoxData.KeyDown += new KeyEventHandler(this.FormPrompt_KeyDown);
this.ButtonOk.Location = new Point(8, 0x100);
this.ButtonOk.Size = new Size(0xe0, 0x38);
this.ButtonOk.Text = "Ok";
this.ButtonOk.Click += new EventHandler(this.ButtonOk_Click);
base.ClientSize = new Size(240, 0x13e);
base.Controls.Add(this.TextBoxData);
base.Controls.Add(this.ButtonOk);
base.Controls.Add(this.LabelPrompt);
base.Controls.Add(this.LabelPleaseEnter);
this.Text = "WinForm";
base.KeyDown += new KeyEventHandler(this.FormPrompt_KeyDown);
}
}


public partial class FormPrompt : Form
{

internal DateTime FDateData;
internal DateTimePicker FDatePicker;
internal decimal FDecimalData;
internal int FIntData;
internal TPromptType FPromptType;
internal string FStringData;


public FormPrompt()
{
this.InitializeComponent();
this.FDatePicker = new DateTimePicker();
this.FDatePicker.Top = this.TextBoxData.Top;
this.FDatePicker.Left = this.TextBoxData.Left;
this.FDatePicker.Width = this.TextBoxData.Width;
this.FDatePicker.Height = this.TextBoxData.Height;
this.FDatePicker.Format = DateTimePickerFormat.Short;
base.Controls.Add(this.FDatePicker);
}
}

最佳答案

我在 Visual Studio 2008 中看到过同样的问题。通常在编译或关闭并重新打开解决方案后,问题会自行解决。在 Visual Studio 2012 中,我知道如果我尝试添加 > 现有项目并选择所有三个文件,我会遇到问题。通常,您只想添加顶级 form.cs,VS 将自动包含 .designer.cs 和 .resx 文件。

关于c# - 表单和设计器文件未在解决方案资源管理器中链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22599843/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com