NeoEvaX

Hello all. First of all I am not entirely sure this is the best place for this question, but I figured I would ask.

I am using Visual Studio 2005. I am programming in Visual basic. Let me explain my problem. I currently have 3 forms. I have worked on them for quite a long time. I went and added 2 buttons to one of the forms. I then double clicked one of the buttons to then add code to the click method. As soon as I did this something very strange happened. An error message popped up complaining about how the button did not exisit. I tried to look at the tab that contained the form designer and it had some crazy error. There were some bright red words etc. I tried to close the tabs and reopen them but when I double click on the vb file in the solution manager it just opens a blank document.

Things I noticed:
The icon for the forms in the solution manager changed. They are no longer little teeny forms. They are now just little vb document icons.

If I right click the vb file there is no option to open in designer.

This also goes for when I right click and do open with.. the designer is not even there.

I tried opening another project that I worked on and it works just fine.

I have not touched any of the code but now I am getting these errors:
Error 1 'Button1' is not a member of 'Face_of_BestRock.prefrences'. C:\Documents and Settings\Ian Kremer\My Documents\Visual Studio 2005\Projects\Face of BestRock\Face of BestRock\prefrences.Designer.vb 3330 9 Face of BestRock
Error 2 'Button1' is not a member of 'Face_of_BestRock.prefrences'. C:\Documents and Settings\Ian Kremer\My Documents\Visual Studio 2005\Projects\Face of BestRock\Face of BestRock\prefrences.Designer.vb 3331 9 Face of BestRock
(there are a few more of these.. didnt want to paste a ton of these)

If I go into the prefrences.Designer.vb and comment out the errors the program still compiles. When I debug it the forms do show up and everything is in the right place and every thing.

I have no idea what to do. This is kinda serious. I really need to be able to work on this program. I tried restarting the program and the computer to no avail. So no undo is available.

ANYhelp would be great!

-Ian Kremer



Re: Windows Forms Designer Form Designer wont load!

Yu Guo – MSFT

Hi, NeoEvaX,

Could you please show us some codes in your Designer.vb file

Especially the part on top, like

Code Block

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _

Partial Class Form1

Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.

<System.Diagnostics.DebuggerNonUserCode()> _

Protected Overrides Sub Dispose(ByVal disposing As Boolean)

Try

If disposing AndAlso components IsNot Nothing Then

components.Dispose()

End If

Finally

MyBase.Dispose(disposing)

End Try

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

<System.Diagnostics.DebuggerStepThrough()> _

Private Sub InitializeComponent()

Me.SuspendLayout()

'

'Form1

'

Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font

Me.ClientSize = New System.Drawing.Size(292, 268)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

End Class

Regards






Re: Windows Forms Designer Form Designer wont load!

NeoEvaX

This is from one of the forms. Is this enough One of the weird things is that this suddenly happend to ALL of the forms. Even the ones I did not change at all. Here goes:

Thanks again for looking at it.

Code Block
Imports System.ComponentModel
Imports System.Collections.Generic

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form

Dim Sample As List(Of testSample) = New List(Of testSample)
'Yes I know Global Variable.. sue me

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.MenuStrip1 = New System.Windows.Forms.MenuStrip
Me.FileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.OpenToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem
Me.toolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator
Me.ExitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.ToolsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.SetOptionsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.SetGenesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.OpenFD = New System.Windows.Forms.OpenFileDialog
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.MenuStrip1.SuspendLayout()
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'MenuStrip1
'
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileToolStripMenuItem, Me.ToolsToolStripMenuItem})
Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
Me.MenuStrip1.Name = "MenuStrip1"
Me.MenuStrip1.Size = New System.Drawing.Size(716, 24)
Me.MenuStrip1.TabIndex = 0
Me.MenuStrip1.Text = "MenuStrip1"
'
'FileToolStripMenuItem
'
Me.FileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.OpenToolStripMenuItem1, Me.toolStripSeparator2, Me.ExitToolStripMenuItem})
Me.FileToolStripMenuItem.Name = "FileToolStripMenuItem"
Me.FileToolStripMenuItem.Size = New System.Drawing.Size(35, 20)
Me.FileToolStripMenuItem.Text = "&File"
'
'OpenToolStripMenuItem1
'
Me.OpenToolStripMenuItem1.Image = CType(resources.GetObject("OpenToolStripMenuItem1.Image"), System.Drawing.Image)
Me.OpenToolStripMenuItem1.ImageTransparentColor = System.Drawing.Color.Magenta
Me.OpenToolStripMenuItem1.Name = "OpenToolStripMenuItem1"
Me.OpenToolStripMenuItem1.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.O), System.Windows.Forms.Keys)
Me.OpenToolStripMenuItem1.Size = New System.Drawing.Size(152, 22)
Me.OpenToolStripMenuItem1.Text = "&Open"
'
'toolStripSeparator2
'
Me.toolStripSeparator2.Name = "toolStripSeparator2"
Me.toolStripSeparator2.Size = New System.Drawing.Size(149, 6)
'
'ExitToolStripMenuItem
'
Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.ExitToolStripMenuItem.Text = "E&xit"
'
'ToolsToolStripMenuItem
'
Me.ToolsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SetOptionsToolStripMenuItem, Me.SetGenesToolStripMenuItem})
Me.ToolsToolStripMenuItem.Name = "ToolsToolStripMenuItem"
Me.ToolsToolStripMenuItem.Size = New System.Drawing.Size(44, 20)
Me.ToolsToolStripMenuItem.Text = "Tools"
'
'SetOptionsToolStripMenuItem
'
Me.SetOptionsToolStripMenuItem.Enabled = False
Me.SetOptionsToolStripMenuItem.Name = "SetOptionsToolStripMenuItem"
Me.SetOptionsToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.SetOptionsToolStripMenuItem.Text = "Set Options"
'
'SetGenesToolStripMenuItem
'
Me.SetGenesToolStripMenuItem.Enabled = False
Me.SetGenesToolStripMenuItem.Name = "SetGenesToolStripMenuItem"
Me.SetGenesToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.SetGenesToolStripMenuItem.Text = "Set Genes"
'
'OpenFD
'
Me.OpenFD.FileName = "OpenFileDialog"
'
'DataGrid1
'
Me.DataGrid1.CaptionVisible = False
Me.DataGrid1.DataMember = ""
Me.DataGrid1.Dock = System.Windows.Forms.DockStyle.Fill
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(0, 24)
Me.DataGrid1.Margin = New System.Windows.Forms.Padding(0)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.RowHeadersVisible = False
Me.DataGrid1.Size = New System.Drawing.Size(716, 358)
Me.DataGrid1.TabIndex = 3
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(716, 382)
Me.Controls.Add(Me.DataGrid1)
Me.Controls.Add(Me.MenuStrip1)
Me.Name = "Form1"
Me.Text = "Face of BestRock"
Me.MenuStrip1.ResumeLayout(False)
Me.MenuStrip1.PerformLayout()
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub




Re: Windows Forms Designer Form Designer wont load!

Yu Guo – MSFT

Hi, NeoEvaX,

Could you please check if the class name is same in the form vb file

And have you applied Visual Studio 2005 SP1

If not, please download and install it.

Regards 






Re: Windows Forms Designer Form Designer wont load!

NeoEvaX

When you say the form vb file you mean (for me) the Form1.vb correct The one that corisponds with Form1.Designer.vb

When I open the Form1.vb file it is totally blank. As is the rest of my form's vb files.

here is a screenshot so you can see what I am trying to discribe: http://nex-verse.com/Myfiles/screenshot.JPG

Sorry I am still somewhat new to Visual Studio in general. (Used to programming in the command line)

As far as I can tell Visual Studio is updated to the most recent SP.






Re: Windows Forms Designer Form Designer wont load!

Yu Guo – MSFT

Hi, NeoEvaX,

Yes, I mean the vb file for your Form.

Could you please close your project, and open the Form1.vb file with other txt editors, such as notepad.exe

The icons are changed because they are no longer recognized as your Form classes.

Regards






Re: Windows Forms Designer Form Designer wont load!

NeoEvaX

When I open Form1.vb in another text program it is totally blank. All of my form.vb files are 0 KB.

now how did that happen

-Ian




Re: Windows Forms Designer Form Designer wont load!

Yu Guo – MSFT

Hi, NeoEvaX,

It seems that this issue rarely happens.

Does it happen in your other projects

Could you find some way to reproduce this issue

Regards






Re: Windows Forms Designer Form Designer wont load!

NeoEvaX

My other projects that are loaded are fine. I am able to view the Form Designer.

I have tried to reproduce it to no avail. The only thing I can think of is the amount of objects on the page. There are quite a lot.

Is there a way to remake the Form1.vb file and have it load again




Re: Windows Forms Designer Form Designer wont load!

Yu Guo – MSFT

Hi, NeoEvaX,

This issue rarely happens, because I cannot find anyone has the same problem throughout the internet.

You can try to add a lot of controls onto your form in some other projects, and check if this issue happens again.

To make it work again, you should add

Code Block

Public Class Form1

End Class

In the vb file of forms, and the class name should be changed according to its original name.

Regards






Re: Windows Forms Designer Form Designer wont load!

NeoEvaX

I added that to the different forms and it seemed to work for most of them, but when I got to the form that caused the problem in the first place. I pasted it in then tried to open for form in the designer and this popped up:

The designer cannot process the code at line 3326: Me.Button1.Location = New System.Drawing.Point(100, 9) The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.


So I commented this part of my code out:

'Button1
'
'Me.Button1.Location = New System.Drawing.Point(100, 9)
'Me.Button1.Name = "Button1"
'Me.Button1.Size = New System.Drawing.Size(75, 23)
'Me.Button1.TabIndex = 50
'Me.Button1.Text = "Done"
'Me.Button1.UseVisualStyleBackColor = True
'
'Button2
'
'Me.Button2.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
'Me.Button2.Location = New System.Drawing.Point(399, 2345)
'Me.Button2.Name = "Button2"
'Me.Button2.Size = New System.Drawing.Size(110, 51)
'Me.Button2.TabIndex = 51
'Me.Button2.Text = "Done"
'Me.Button2.UseVisualStyleBackColor = True
'

(also this code)
'Me.Controls.Add(Me.Button2)
'Me.Controls.Add(Me.Button1)

And that seemed to fix it. I can now open the different forms just fine! Thank you so much. As far as I can tell that error I just posted was the same one that popped up at the start. Very strange.

Anyway. As far as I can tell that is the answer. Thanks again!