There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot computer connection crash css dell display driver drivers email error ethernet excel explorer firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop lcd linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition printer problem router slow software sound startup trojan usb virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Ressurect closed forms in VB.Net


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
Neophyte Nerd's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: Oct 2007
Experience: Beginner
05-Oct-2007, 12:01 PM #1
Ressurect closed forms in VB.Net
My apologies if this question is too dumb. It's the first question I ever posted about programming.

I wrote a program in VB.Net that uses three somewhat complicated forms. The program works as I wanted. Then, in the VB Editor, I closed the forms. The program still works well, for it has the code to create each of the forms.

Next I wanted to change the forms and add new things to them. I thought I could open the forms again in the editor, as easily as I had closed them. Apparently they are gone.

Is there anyway I can resurrect those forms in the editor so that I can revise them?

My only alternative appears to be to make a new program, recreate the forms and hope I have the same names and properties for all the objects in the forms, and then copy the VB.Net code from the first version into the new version. That will take an extra three or four hours. There must be a better way.

Neophyte Nerd
artur02's Avatar
Computer Specs
Member with 91 posts.
 
Join Date: Sep 2007
Location: Hungary
Experience: Advanced
06-Oct-2007, 07:04 AM #2
You have to select Solution Explorer (View/Solution Explorer) and find your Form. DoubleClick on your form. Designer should appear. If it does not, right click on your form and select "View Designer".

If you can't find these menu items, please post your source code of YourFormName.Designer.vb. You have to turn on Show All Files to see it. You should see something like this:

Code:
 _
Partial Class Form1
    Inherits System.Windows.Forms.Form
__________________
Artúr Herczeg
artur02
http://techies.teamlupus.hu
Neophyte Nerd's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: Oct 2007
Experience: Beginner
06-Oct-2007, 08:40 AM #3
Your help is appreciated. One of my lost forms is “FoundWords”. In the Solution Explorer, under “FoundWords.vb” there is the file “FoundWords.Designer.vb” (and the other file is “FoundWords.resx”). The code in that designer file is:

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FoundWords
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.RTFBoxFoundWords = New System.Windows.Forms.RichTextBox
Me.SuspendLayout()
'
'RTFBoxFoundWords
'
Me.RTFBoxFoundWords.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
Me.RTFBoxFoundWords.Dock = System.Windows.Forms.DockStyle.Fill
Me.RTFBoxFoundWords.Location = New System.Drawing.Point(0, 0)
Me.RTFBoxFoundWords.Name = "RTFBoxFoundWords"
Me.RTFBoxFoundWords.Size = New System.Drawing.Size(331, 392)
Me.RTFBoxFoundWords.TabIndex = 0
Me.RTFBoxFoundWords.Text = ""
'
'FoundWords
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(331, 392)
Me.Controls.Add(Me.RTFBoxFoundWords)
Me.Name = "FoundWords"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Mots passants - mots trouvés"
Me.ResumeLayout(False)

End Sub
Friend WithEvents RTFBoxFoundWords As System.Windows.Forms.RichTextBox
End Class
(End of listing)

I do not see the form itself such that I could revise it on screen, but the code at least gives me information about what the old form contained, and I can use that information when trying to recreate the form in a new, second attempt to create the program.
Neophyte Nerd's Avatar
Computer Specs
Junior Member with 6 posts.
 
Join Date: Oct 2007
Experience: Beginner
10-Oct-2007, 10:12 AM #4
I appreciate the help that Artúr Herczeg gave on my problem. I did what he said, and had no luck, but the information inside that location gave me the properties and names of all the windows and the objects on them.

I then made a new version of my program and had the forms in the new version replicate exactly what the old program had.

That took a bit of time, and in the meantime I wrote some more code into the old version of the program in order later to copy it into the new version of the program.

After a couple of days of coding, I discovered that the forms that were missing in the old program and that caused all this trouble had suddenly reappeared with no explanation as to how they got there.

The moral seems to be that unless one knows what one is doing, one should NEVER close a form in a VB.Net program. I am grateful for the help that Mr. Herczeg gave me on this problem. He was perhaps the cause of the forms reappearing, but it is a mystery to me.

I consider this problem closed, unless anyone wants to add comments to explain what really happened.
Neophyte Nerd
Priddis, Alberta (near the Rocky Mountains)
AB0404's Avatar
Junior Member with 2 posts.
 
Join Date: Nov 2007
Experience: Intermediate
29-Nov-2007, 07:41 PM #5
Missing Forms in VB.net 2005
I was searching for the solution to my problem (my forms were missing from my program, but all of their code was still there and they would appear when i ran my program, but i could not access the desiger view of the form) and I found an easy solution for those who might encounter this problem...Simply copy all of the code from the forms (both windows generated and user generated) and paste into the code area of a new form and it should create you original form again. As simple as this seems, at first i was thinking what everyone else was thinking, simply to redesign the forms and use the same names, but this is much easier. Hope it helps!
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:15 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.