-
Can a form file be edited as a text file?
I'm a newbie on .net and now starting to use VB.net.
I opened a .designer.vb file of a form and edited a control. Later on I found I could not view the form in [design] view any more. The icon of the .vb file has changed from a form to a vb code file.
Is there anyway / chance to change it back, to let the environment recognize the .vb file as a form? Can a form file be edited as a text file?
-
What did you do on the "edit"?
When you tried to view the form from the IDE, what happened?
Are we talking about a Windows Form or a Web Form?
-
It's a windows form.
What I did is:
1. show all files in Solution Explorer and expanded Form1
2. double clicked on Form1.Designer.vb
3. changed one control name in the Sub InitializeComponent()
4. ran it and got error
5. changed the control name back, the error was eliminated and the program ran normally
6. I found the icon of Form1.vb in Solution Explorer has changed from a form icon to code file icon and I could not view the form in [design] mode. The form is recognized by VB.net as a code file, when view the form in IDE, I get the code, not a form displayed.
I had crashed certain thing. My concern is in this case, can I change the code file back to a form to edit my form intuitively?
-
Edit the project (.vbproj) file. Change the offending element's SubType from "Code" to "Form". Most of the time you'll get the Form icon back. Sometimes you'll get the Component icon. In either case you should then get the 'View Designer' option in the solution explorer.
<Files>
<Include>
<File
RelPath = "AssemblyInfo.vb"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Form1.vb"
SubType = "Form"
BuildAction = "Compile"
/>
-
You are dditing the wrong file
The first error was in editing the form1.designer.vb. That is the file that is created by the forms designer and contains the _generated_ code associated with the form. You should not change it because any changes in it are 1) not reflected in the form itself, 2) will probably get lost when the designer closes the form. You should open the form1.vb file in the designer and make your changes in the visual forms designer.
 Originally Posted by SnoopyYang
It's a windows form.
What I did is:
1. show all files in Solution Explorer and expanded Form1
2. double clicked on Form1.Designer.vb
3. changed one control name in the Sub InitializeComponent()
4. ran it and got error
5. changed the control name back, the error was eliminated and the program ran normally
6. I found the icon of Form1.vb in Solution Explorer has changed from a form icon to code file icon and I could not view the form in [design] mode. The form is recognized by VB.net as a code file, when view the form in IDE, I get the code, not a form displayed.
I had crashed certain thing. My concern is in this case, can I change the code file back to a form to edit my form intuitively?
Similar Threads
-
By persian_celina in forum .NET
Replies: 0
Last Post: 02-19-2006, 03:06 AM
-
By Kevin in forum VB Classic
Replies: 3
Last Post: 12-05-2005, 07:25 PM
-
By vimala in forum VB Classic
Replies: 1
Last Post: 03-23-2005, 12:18 AM
-
By Paul in forum Database
Replies: 0
Last Post: 08-22-2000, 10:54 PM
-
By deborah in forum authorevents.kurata
Replies: 0
Last Post: 04-17-2000, 01:33 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|