473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Rebuild Windows Forms Designer Generated Code

Is there a way to rebuild the code that is generated by the forms designer? It compiles, but it seems to have controls left in it that I previously removed using the designer. I'd like to just rebuild it all to ensure it is clean and does not have unnecessary code in it. (The Rebuild command does not do this.)
Nov 20 '05 #1
4 3753
gsilvey,
The "Oh my god, what have I done method":
- Open your form in the Forms Designer
- Use Edit Select All to select all the controls
- Use Edit Delete to delete all the controls
- Use the toolbox to add all the controls you actually want
- Use the properties window to set the properties you actually want

Otherwise, there is no way to "rebuild" the code, as the code generated IS
your form design (the design is not stored any place else). There is
additional information on the design in the .resx file, however the bulk of
the form's design is the generated code itself.

Hope this helps
Jay

"gsilvey" <an*******@discussions.microsoft.com> wrote in message
news:A5**********************************@microsof t.com...
Is there a way to rebuild the code that is generated by the forms

designer? It compiles, but it seems to have controls left in it that I
previously removed using the designer. I'd like to just rebuild it all to
ensure it is clean and does not have unnecessary code in it. (The Rebuild
command does not do this.)
Nov 20 '05 #2
Hi Jay,

I was just thinking about you and thought, Jay never makes jokes in this
newsgroup always serious and than this.
The "Oh my god, what have I done method":


I was really laughing (friendly of course).

Cor
Nov 20 '05 #3
Cor,
I wanted to make sure that gsilvey was thinking before he actually tried my
method...

Jay

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:uG**************@TK2MSFTNGP09.phx.gbl...
Hi Jay,

I was just thinking about you and thought, Jay never makes jokes in this
newsgroup always serious and than this.
The "Oh my god, what have I done method":


I was really laughing (friendly of course).

Cor

Nov 20 '05 #4
I've got way too many controls to do that. Your suggestion gave me an idea though. I did a select all and then a delete. I then went to the source viewer and removed what was left. There were still about 20 controls in there. I then went back to the designer and did a paste. That seems to have worked, however I still get the error I was previously getting... (See my other thread here about InitializeComponent() exception in .NET General

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ayende Rahien | last post by:
Excetremely annoying problem, I've an application with a long startup time. So I created another form with my logo in it to as a splash screen. The splash screen is run from another thread and is...
5
by: Dave | last post by:
How do I check in a Windows Forms app if any controls have changed? I have a form that collects data, and I want to prompt the user if they try to exit the app, or load a new file, without saving...
5
by: david | last post by:
I have developed my web service with a domain name of my computer name and wwwroot directory. I also developed a client of windows form application. It works locally (i.e. in the same machine). ...
1
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
0
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. The program I'm trying to develop needs to be able to do the following: - Select remote server -...
8
by: Alison | last post by:
Hi, Al I am trying to design a user interface which provides both menus and toolbars for some users to click on whatever they want to do, at the same time, I would like to have a console window...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
5
by: Fredrik Melin | last post by:
2005 uses the Partial Class & <form>.Designer.vb for its "windows forms generated code" Anyone know if its faster/better then old 2003 way? Also, when upgrading a 2003 project it did not...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.