VB.NET crashed > form is empty

Raddict

Active member
Joined
May 19, 2005
Messages
28
Location
Rotterdam (Holland)
Programming Experience
3-5
VB.NET 2003 reported a terminal error.
After my restart the form in my project was empty. All the codes are still there, but the components are missing from the designer.

Does anyone know a way to correct this?
The auto generated code about the components is still there.
 

kulrom

Well-known member
Joined
May 10, 2005
Messages
2,854
Location
Republic of Macedonia
Programming Experience
10+
Hello,
Go in designer (design view) ... in the properties window select one of the controls (i.e. textbox) and see its location X, Y ... let us know does it Exceed the size (border) of your form
It’s happening that controls are moved by some reason :( but I’m not sure why it is so



Cheers :)

edit:
Btw, welcome to the forum ;) and have a nice presence on this board
 
Last edited:

Raddict

Active member
Joined
May 19, 2005
Messages
28
Location
Rotterdam (Holland)
Programming Experience
3-5
None of the components exist in the design view anymore.
The only thing that remains are their declarations in the Code as partly seen below:
Friend WithEvents lstSwitchTimes2 As System.Windows.Forms.CheckedListBox
Friend WithEvents lstSwitchTimes3 As System.Windows.Forms.CheckedListBox
Friend WithEvents lstSwitchTimes4 As System.Windows.Forms.CheckedListBox
Friend WithEvents lstSwitchTimes5 As System.Windows.Forms.CheckedListBox
Friend WithEvents lstSwitchTimes6 As System.Windows.Forms.CheckedListBox
Friend WithEvents lstSwitchTimes7 As System.Windows.Forms.CheckedListBox
Friend WithEvents lstSwitchTimes8 As System.Windows.Forms.CheckedListBox
Friend WithEvents Button6 As System.Windows.Forms.Button
Me.components = New System.ComponentModel.Container
Me.Button1 = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button2 = New System.Windows.Forms.Button
Me.tabRelais = New System.Windows.Forms.TabControl
Me.TabPage1 = New System.Windows.Forms.TabPage
Me.lstSwitchTimes1 = New System.Windows.Forms.CheckedListBox
Me.frameSwitchMethod1 = New System.Windows.Forms.GroupBox
Me.optSolar1 = New System.Windows.Forms.RadioButton

I can try to place all the components back and give them their approriate name and settings back. But I would like it if there is a easier way ;)

EDIT:
I seem to get an error message (syntax error) on the word "me".
When I put the components back, and try to rename them to their original name I get an error that there already is a component with that name.:(
 
Last edited:

kulrom

Well-known member
Joined
May 10, 2005
Messages
2,854
Location
Republic of Macedonia
Programming Experience
10+
Hi,
I'm not sure what is going on there ... but i think there must be something missing in following my instruction (components are there but have changed their location) ... have a look at properties window ones again.

btw, there are too many reasons for this issue like modifying of control's Style is. So, I will wait for your feedback ...
Meanwhile, you could take a look at the controlDesigner class if you don't find the reason for certain problem ... this class provide ability that you can create a custom designer and associate it with your control ...
Cheers ;)
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,580
Location
Sydney, Australia
Programming Experience
10+
I have had similar problems at times and I have not been able to find an easy way to remedy them. It seems as though the designer looses its relationship to the code somehow. I don't think trying to re-add the controls will help because in my case it just told that a control with that name already existed. I got around the problem by creating a new Form and then, with the design window closed, pasted all the code from the original form into the new one. You may have to do a bit of fiddling but I found this to be the best solution.

By the way, this is an IDE related issue and there is section of this forum devoted specifically to the IDE.
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
this problem was quite bad with vs2002 (or so i heard) i havent had this problem in vs2003 yet but microsoft *claims* that it's no longer an issue with vs2005
 

Raddict

Active member
Joined
May 19, 2005
Messages
28
Location
Rotterdam (Holland)
Programming Experience
3-5
I solved it by recreating the form in in new project, restoring al the names and copy paste the code. At first this reproduced my original problem (fortunately I saved everything), but when I very carefully copied only the used code it worked.

So everything is working again :)
 
Top Bottom