I was able to extract all the code from a VB.NET .exe I build a while ago into a VB.NET Project but when I clicked on View Design inside of my editor, I get a bunch of errors that say the form properties. I have over a hundred errors that look like this;

The type 'System.Windows.Forms.Form' has no property named 'Label3'

Every label, textbox, button or item that was used to build the project has an associated error. Are my forms gone?

There is also a new Sub in my .vb code that I don't recognize, it looks like this. Is this sub trying to build a non-existent form? Can I get my forms back?
       Private Sub InitializeComponent()
            Dim resources As New ComponentResourceManager(GetType(splash))
            Me.lineShape1 = New LineShape
            Me.label1 = New Label
            Me.lblCurrentCalc = New Label
            Me.Label3 = New Label
            Me.Label4 = New Label
            Me.Label5 = New Label
            Me.lblRPMCalc = New Label
            Me.Label7 = New Label
            Me.lblFraction2Dec = New Label
            Me.Label9 = New Label
            Me.lblDec2Frac = New Label
            Me.Label11 = New Label
            Me.lblMM2Inch = New Label
            Me.LinkLabel1 = New LinkLabel
            Me.lblVersion = New Label
            Me.SuspendLayout
            Me.lineShape1.Name = ""
            Me.lineShape1.X1 = 0
            Me.lineShape1.X2 = 0
            Me.lineShape1.Y1 = 0
            Me.lineShape1.Y2 = 0
            Me.label1.BackColor = Color.Transparent
            Me.label1.Font = New Font("SHINJI BLUES", 27.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            Me.label1.ForeColor = Color.FromArgb(&HC0, 0, 0)
            Dim VB$t_struct$S0 As New Point(&H56, 20)
            Me.label1.Location = VB$t_struct$S0
            Me.label1.Name = "label1"
            Dim VB$t_struct$S1 As New Size(&HF2, &H24)
            Me.label1.Size = VB$t_struct$S1
            Me.label1.TabIndex = 1
            Me.label1.Text = "Shop Tools"
            Me.label1.TextAlign = ContentAlignment.MiddleCenter
            Me.lblCurrentCalc.AutoSize = True
            Me.lblCurrentCalc.BackColor = Color.Transparent
            Me.lblCurrentCalc.Font = New Font("Segoe UI", 12!, FontStyle.Underline, GraphicsUnit.Point, 0)
            Me.lblCurrentCalc.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(&H1C, &HBA)
            Me.lblCurrentCalc.Location = VB$t_struct$S0
            Me.lblCurrentCalc.Name = "lblCurrentCalc"
            VB$t_struct$S1 = New Size(&H89, &H15)
            Me.lblCurrentCalc.Size = VB$t_struct$S1
            Me.lblCurrentCalc.TabIndex = 2
            Me.lblCurrentCalc.Text = "Current Calculator"
            Me.Label3.AutoSize = True
            Me.Label3.BackColor = Color.Transparent
            Me.Label3.Font = New Font("Segoe UI", 9!, FontStyle.Regular, GraphicsUnit.Point, 0)
            VB$t_struct$S0 = New Point(12, &H86)
            Me.Label3.Location = VB$t_struct$S0
            Me.Label3.Name = "Label3"
            VB$t_struct$S1 = New Size(&HD5, &H2D)
            Me.Label3.Size = VB$t_struct$S1
            Me.Label3.TabIndex = 3
            Me.Label3.Text = "Select from the following tools." & ChrW(13) & ChrW(10) & "You will be able to accesss any tool" & ChrW(13) & ChrW(10) & "from the Tools menu of your selection." & ChrW(13) & ChrW(10)
            Me.Label4.AutoSize = True
            Me.Label4.BackColor = Color.Transparent
            Me.Label4.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(14, 190)
            Me.Label4.Location = VB$t_struct$S0
            Me.Label4.Name = "Label4"
            VB$t_struct$S1 = New Size(14, 13)
            Me.Label4.Size = VB$t_struct$S1
            Me.Label4.TabIndex = 4
            Me.Label4.Text = ChrW(9679)
            Me.Label5.AutoSize = True
            Me.Label5.BackColor = Color.Transparent
            Me.Label5.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(14, &HD8)
            Me.Label5.Location = VB$t_struct$S0
            Me.Label5.Name = "Label5"
            VB$t_struct$S1 = New Size(14, 13)
            Me.Label5.Size = VB$t_struct$S1
            Me.Label5.TabIndex = 6
            Me.Label5.Text = ChrW(9679)
            Me.lblRPMCalc.AutoSize = True
            Me.lblRPMCalc.BackColor = Color.Transparent
            Me.lblRPMCalc.Font = New Font("Segoe UI", 12!, FontStyle.Underline, GraphicsUnit.Point, 0)
            Me.lblRPMCalc.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(&H1C, &HD4)
            Me.lblRPMCalc.Location = VB$t_struct$S0
            Me.lblRPMCalc.Name = "lblRPMCalc"
            VB$t_struct$S1 = New Size(&HA3, &H15)
            Me.lblRPMCalc.Size = VB$t_struct$S1
            Me.lblRPMCalc.TabIndex = 5
            Me.lblRPMCalc.Text = "Pulley RPM Calculator"
            Me.Label7.AutoSize = True
            Me.Label7.BackColor = Color.Transparent
            Me.Label7.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(14, &HF2)
            Me.Label7.Location = VB$t_struct$S0
            Me.Label7.Name = "Label7"
            VB$t_struct$S1 = New Size(14, 13)
            Me.Label7.Size = VB$t_struct$S1
            Me.Label7.TabIndex = 8
            Me.Label7.Text = ChrW(9679)
            Me.lblFraction2Dec.AutoSize = True
            Me.lblFraction2Dec.BackColor = Color.Transparent
            Me.lblFraction2Dec.Font = New Font("Segoe UI", 12!, FontStyle.Underline, GraphicsUnit.Point, 0)
            Me.lblFraction2Dec.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(&H1C, &HEE)
            Me.lblFraction2Dec.Location = VB$t_struct$S0
            Me.lblFraction2Dec.Name = "lblFraction2Dec"
            VB$t_struct$S1 = New Size(&H8B, &H15)
            Me.lblFraction2Dec.Size = VB$t_struct$S1
            Me.lblFraction2Dec.TabIndex = 7
            Me.lblFraction2Dec.Text = "Fraction 2 Decimal"
            Me.Label9.AutoSize = True
            Me.Label9.BackColor = Color.Transparent
            Me.Label9.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(14, &H10C)
            Me.Label9.Location = VB$t_struct$S0
            Me.Label9.Name = "Label9"
            VB$t_struct$S1 = New Size(14, 13)
            Me.Label9.Size = VB$t_struct$S1
            Me.Label9.TabIndex = 10
            Me.Label9.Text = ChrW(9679)
            Me.lblDec2Frac.AutoSize = True
            Me.lblDec2Frac.BackColor = Color.Transparent
            Me.lblDec2Frac.Font = New Font("Segoe UI", 12!, FontStyle.Underline, GraphicsUnit.Point, 0)
            Me.lblDec2Frac.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(&H1C, &H108)
            Me.lblDec2Frac.Location = VB$t_struct$S0
            Me.lblDec2Frac.Name = "lblDec2Frac"
            VB$t_struct$S1 = New Size(&H8B, &H15)
            Me.lblDec2Frac.Size = VB$t_struct$S1
            Me.lblDec2Frac.TabIndex = 9
            Me.lblDec2Frac.Text = "Decimal 2 Fraction"
            Me.Label11.AutoSize = True
            Me.Label11.BackColor = Color.Transparent
            Me.Label11.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(14, &H126)
            Me.Label11.Location = VB$t_struct$S0
            Me.Label11.Name = "Label11"
            VB$t_struct$S1 = New Size(14, 13)
            Me.Label11.Size = VB$t_struct$S1
            Me.Label11.TabIndex = 12
            Me.Label11.Text = ChrW(9679)
            Me.lblMM2Inch.AutoSize = True
            Me.lblMM2Inch.BackColor = Color.Transparent
            Me.lblMM2Inch.Font = New Font("Segoe UI", 12!, FontStyle.Underline, GraphicsUnit.Point, 0)
            Me.lblMM2Inch.ForeColor = Color.FromArgb(0, 0, &HC0)
            VB$t_struct$S0 = New Point(&H1C, 290)
            Me.lblMM2Inch.Location = VB$t_struct$S0
            Me.lblMM2Inch.Name = "lblMM2Inch"
            VB$t_struct$S1 = New Size(&H9D, &H15)
            Me.lblMM2Inch.Size = VB$t_struct$S1
            Me.lblMM2Inch.TabIndex = 11
            Me.lblMM2Inch.Text = "mm 2 inch Converter"
            Me.LinkLabel1.AutoSize = True
            Me.LinkLabel1.Font = New Font("Segoe UI", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
            VB$t_struct$S0 = New Point(&HC2, 480)
            Me.LinkLabel1.Location = VB$t_struct$S0
            Me.LinkLabel1.Name = "LinkLabel1"
            VB$t_struct$S1 = New Size(&H2D, 13)
            Me.LinkLabel1.Size = VB$t_struct$S1
            Me.LinkLabel1.TabIndex = 14
            Me.LinkLabel1.TabStop = True
            Me.LinkLabel1.Text = "Donate"
            Me.lblVersion.BackColor = Color.Transparent
            Me.lblVersion.Cursor = Cursors.Default
            Me.lblVersion.Font = New Font("Segoe UI", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
            Me.lblVersion.ForeColor = SystemColors.ControlText
            VB$t_struct$S0 = New Point(&H60, &H3A)
            Me.lblVersion.Location = VB$t_struct$S0
            Me.lblVersion.Name = "lblVersion"
            Me.lblVersion.RightToLeft = RightToLeft.No
            VB$t_struct$S1 = New Size(&H111, 15)
            Me.lblVersion.Size = VB$t_struct$S1
            Me.lblVersion.TabIndex = 15
            Me.lblVersion.Tag = "Version"
            Me.lblVersion.Text = "Version 2.1.0"
            Me.lblVersion.TextAlign = ContentAlignment.MiddleLeft
            Dim VB$t_struct$S2 As New SizeF(6!, 13!)
            Me.AutoScaleDimensions = VB$t_struct$S2
            Me.AutoScaleMode = AutoScaleMode.Font
            Me.BackgroundImage = DirectCast(resources.GetObject("$this.BackgroundImage"), Image)
            Me.BackgroundImageLayout = ImageLayout.None
            VB$t_struct$S1 = New Size(&H151, &H1FA)
            Me.ClientSize = VB$t_struct$S1
            Me.Controls.Add(Me.lblVersion)
            Me.Controls.Add(Me.LinkLabel1)
            Me.Controls.Add(Me.Label11)
            Me.Controls.Add(Me.lblMM2Inch)
            Me.Controls.Add(Me.Label9)
            Me.Controls.Add(Me.lblDec2Frac)
            Me.Controls.Add(Me.Label7)
            Me.Controls.Add(Me.lblFraction2Dec)
            Me.Controls.Add(Me.Label5)
            Me.Controls.Add(Me.lblRPMCalc)
            Me.Controls.Add(Me.Label4)
            Me.Controls.Add(Me.Label3)
            Me.Controls.Add(Me.lblCurrentCalc)
            Me.Controls.Add(Me.label1)
            Me.Icon = DirectCast(resources.GetObject("$this.Icon"), Icon)
            Me.MaximizeBox = False
            Me.Name = "splash"
            Me.StartPosition = FormStartPosition.CenterScreen
            Me.Text = "Shop Tools"
            Me.TopMost = True
            Me.ResumeLayout(False)
            Me.PerformLayout
        End Sub
mgfranz
0

Comments

1 comment

  • Clive Tong
    The InitializeComponent Sub, that you've listed above, is the code that is normally in a form's .Designer.vb file. This code is written out by the designer to save the state of the controls on the form.

    With some effort I managed to get the designer happy with the Reflector generated code from a simple WindowsForms application that I wrote. This involved fixing up some usages of generics, changing some property definitions to use the syntax
      Friend WithEvents Button1 As System.Windows.Forms.Button
    

    and modifying the code in the regenerated InitializeComponent method to avoid assigning new instances to local variables.

    So, you can probably get your forms back, but it will take some effort to get the code into a form that the designer successfully handles.
    Clive Tong
    0

Add comment

Please sign in to leave a comment.