我可以使用Form1.Designer.cs重建我的视觉形式吗? [英] Can my visual forms be reconstructed using Form1.Designer.cs?

查看:79
本文介绍了我可以使用Form1.Designer.cs重建我的视觉形式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当VS给我一个错误信息时,我丢失了我的视觉形式。  我仍然拥有在运行时构建显示的C#代码,但不再具有我在Form1.cs [design]窗口中构建的代码。  我可以从下面重建我的设计窗口(这里只有
部分)吗?:

I lost my visual forms when VS gave me an error message.  I still have the C# code that constructs the display at run time, but no longer have what I built in Form1.cs [design] window.  Can I reconstruct my design window from the following (only part of it here)?:

命名空间SciBowlClockII

{

   部分班级ClockBase

    {

  &NBSP; &NBSP; &NBSP; ///< summary>

  &NBSP; &NBSP; &NBSP; ///所需的设计师变量。

  &NBSP; &NBSP; &NBSP; ///< / summary>

  &NBSP; &NBSP; &NBSP; private System.ComponentModel.IContainer components = null;



  &NBSP; &NBSP; &NBSP; ///< summary>

  &NBSP; &NBSP; &NBSP; ///清理正在使用的所有资源。

  &NBSP; &NBSP; &NBSP; ///< / summary>

  &NBSP; &NBSP; &NBSP; ///< param name =" disposing">如果应该处理托管资源,则为true;否则,为假。< / param>

  &NBSP; &NBSP; &NBSP; protected override void Dispose(bool disposing)

  &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; if(disposing&&(components!= null))

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; components.Dispose();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; }¥b $ b  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; base.Dispose(disposing);

  &NBSP; &NBSP; &NBSP; }


  &NBSP; &NBSP; &NBSP; #region Windows窗体设计器生成的代码



  &NBSP; &NBSP; &NBSP; ///< summary>

  &NBSP; &NBSP; &NBSP; ///支持Designer的必需方法 - 请勿修改

  &NBSP; &NBSP; &NBSP; ///使用代码编辑器的方法内容。

  &NBSP; &NBSP; &NBSP; ///< / summary>

  &NBSP; &NBSP; &NBSP; private void InitializeComponent()

  &NBSP; &NBSP; &NBSP; {

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.components = new System.ComponentModel.Container();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl = new System.Windows.Forms.TabControl();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabMain = new System.Windows.Forms.TabPage();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.bClos​​eMainTab = new System.Windows.Forms.Button();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.button1 = new System.Windows.Forms.Button();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbROUND = new System.Windows.Forms.GroupBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.vsbrRndSecs = new System.Windows.Forms.VScrollBar();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.vsbrRndMins = new System.Windows.Forms.VScrollBar();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.lRC = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbTUB = new System.Windows.Forms.GroupBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.lTBC = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.label2 = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbRT = new System.Windows.Forms.GroupBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbRTD = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbRTC = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbRTB = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbRTA = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbRQ = new System.Windows.Forms.GroupBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.nudQuestion = new System.Windows.Forms.NumericUpDown();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.nudRound = new System.Windows.Forms.NumericUpDown();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.lRQ = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabTeams = new System.Windows.Forms.TabPage();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.lTeamPickErr = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.bClos​​eTeamTab = new System.Windows.Forms.Button();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.groupBox1 = new System.Windows.Forms.GroupBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbTDR = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbTCR = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbTBR = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbTAR = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbLeftTeams = new System.Windows.Forms.GroupBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbTDL = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbTCL = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbTBL = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.rbTAL = new System.Windows.Forms.RadioButton();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tbTeamNameD = new System.Windows.Forms.TextBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tbTeamNameC = new System.Windows.Forms.TextBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tbTeamNameB = new System.Windows.Forms.TextBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.lTeamLetterD = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.lTeamLetterC = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.lTeamLetterB = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.lTeamLetterA = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tbTeamNameA = new System.Windows.Forms.TextBox();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.label1 = new System.Windows.Forms.Label();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tcRound = new System.Windows.Forms.Timer(this.components);

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tcTossBonus = new System.Windows.Forms.Timer(this.components);

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabMain.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbROUND.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbTUB.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbRT.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbRQ.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; ((System.ComponentModel.ISupportInitialize)(this.nudQuestion))。BeginInit();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; ((System.ComponentModel.ISupportInitialize)(this.nudRound))。BeginInit();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabTeams.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.groupBox1.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.gbLeftTeams.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.SuspendLayout();

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; // 

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; // tabCntl

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; // 

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl.Controls.Add(this.tabMain);

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl.Controls.Add(this.tabTeams);

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl.Location = new System.Drawing.Point(0,3);

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl.Name =" tabCntl";

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl.SelectedIndex = 0;

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl.Size = new System.Drawing.Size(1074,610);

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; this.tabCntl.TabIndex = 0;

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; // 

namespace SciBowlClockII
{
    partial class ClockBase
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.tabCntl = new System.Windows.Forms.TabControl();
            this.tabMain = new System.Windows.Forms.TabPage();
            this.bCloseMainTab = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.gbROUND = new System.Windows.Forms.GroupBox();
            this.vsbrRndSecs = new System.Windows.Forms.VScrollBar();
            this.vsbrRndMins = new System.Windows.Forms.VScrollBar();
            this.lRC = new System.Windows.Forms.Label();
            this.gbTUB = new System.Windows.Forms.GroupBox();
            this.lTBC = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.gbRT = new System.Windows.Forms.GroupBox();
            this.rbRTD = new System.Windows.Forms.RadioButton();
            this.rbRTC = new System.Windows.Forms.RadioButton();
            this.rbRTB = new System.Windows.Forms.RadioButton();
            this.rbRTA = new System.Windows.Forms.RadioButton();
            this.gbRQ = new System.Windows.Forms.GroupBox();
            this.nudQuestion = new System.Windows.Forms.NumericUpDown();
            this.nudRound = new System.Windows.Forms.NumericUpDown();
            this.lRQ = new System.Windows.Forms.Label();
            this.tabTeams = new System.Windows.Forms.TabPage();
            this.lTeamPickErr = new System.Windows.Forms.Label();
            this.bCloseTeamTab = new System.Windows.Forms.Button();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.rbTDR = new System.Windows.Forms.RadioButton();
            this.rbTCR = new System.Windows.Forms.RadioButton();
            this.rbTBR = new System.Windows.Forms.RadioButton();
            this.rbTAR = new System.Windows.Forms.RadioButton();
            this.gbLeftTeams = new System.Windows.Forms.GroupBox();
            this.rbTDL = new System.Windows.Forms.RadioButton();
            this.rbTCL = new System.Windows.Forms.RadioButton();
            this.rbTBL = new System.Windows.Forms.RadioButton();
            this.rbTAL = new System.Windows.Forms.RadioButton();
            this.tbTeamNameD = new System.Windows.Forms.TextBox();
            this.tbTeamNameC = new System.Windows.Forms.TextBox();
            this.tbTeamNameB = new System.Windows.Forms.TextBox();
            this.lTeamLetterD = new System.Windows.Forms.Label();
            this.lTeamLetterC = new System.Windows.Forms.Label();
            this.lTeamLetterB = new System.Windows.Forms.Label();
            this.lTeamLetterA = new System.Windows.Forms.Label();
            this.tbTeamNameA = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.tcRound = new System.Windows.Forms.Timer(this.components);
            this.tcTossBonus = new System.Windows.Forms.Timer(this.components);
            this.tabCntl.SuspendLayout();
            this.tabMain.SuspendLayout();
            this.gbROUND.SuspendLayout();
            this.gbTUB.SuspendLayout();
            this.gbRT.SuspendLayout();
            this.gbRQ.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.nudQuestion)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.nudRound)).BeginInit();
            this.tabTeams.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.gbLeftTeams.SuspendLayout();
            this.SuspendLayout();
            // 
            // tabCntl
            // 
            this.tabCntl.Controls.Add(this.tabMain);
            this.tabCntl.Controls.Add(this.tabTeams);
            this.tabCntl.Location = new System.Drawing.Point(0, 3);
            this.tabCntl.Name = "tabCntl";
            this.tabCntl.SelectedIndex = 0;
            this.tabCntl.Size = new System.Drawing.Size(1074, 610);
            this.tabCntl.TabIndex = 0;
            // 

... snip

  ...

 ...

我也是抓住了这个:

推荐答案

您好Geneous42,

Hi Geneous42,

感谢您在此处发帖。

Form1.designer.cs是表单元素的设计器文件被初始化。如果在表单窗口中拖放任何元素,那么该元素将在此类中自动初始化。

Form1.designer.cs is the designer file where form elements are initialized. If any element is dragged and dropped in the form window then that element will be automatically initialized in this class.

在Form1.designer.cs中,我们可以得到r equired designer variable and r equired method为Designer支持。但是我们不能做
就像反编译for dll。

In Form1.designer.cs, we could get the required designer variable and required method for Designer support. But we could not do something like decompile for dll.

我希望这会有所帮助。

最好的问候,

Wendy


这篇关于我可以使用Form1.Designer.cs重建我的视觉形式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆