| | |
What is designer.cs?
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
0
#2 Nov 2nd, 2009
It is a code file automatically generated by your designer to hold the form's layout information that was created using the Visual Studio IDE. Previous versions of Visual Studio stored all of the information contained in the .designer.cs file in the main code file but the split it out due to user feedback.
Basically it means the ".designer.cs" file is for setting up the form where you can drag buttons around, add panels, resize the form, etc. Whenever you make a change visually with the development environment the changes are stored in .designer.cs.
Basically it means the ".designer.cs" file is for setting up the form where you can drag buttons around, add panels, resize the form, etc. Whenever you make a change visually with the development environment the changes are stored in .designer.cs.
0
#3 Nov 2nd, 2009
Also notice the concept of a partial class. The X.cs and X.designer.cs files form the same class but are marked partial so they can be stored separately. You should in general not change the contents of the .designer.cs file, the IDE does that for you.
I give it a look from times to see how things get done, in the case I want to code something manually myself.
I give it a look from times to see how things get done, in the case I want to code something manually myself.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
0
#5 Nov 2nd, 2009
If I where you I should never delete the designer file. Consider it as a file that must be there as long as you are developing.
Take this test: create a forms app, put a button(whatever) on the form give it a name open the designer file and look the code that is automatically generated for it. Now change some properties of the button (position size etc.) now go to the designer file again and see how the code is changed, without you having to do it.
Most of the time I use VS C# 2008 Express. Under the build menu you will find a Publish option. Use it and see what happens. Happy computing!
Take this test: create a forms app, put a button(whatever) on the form give it a name open the designer file and look the code that is automatically generated for it. Now change some properties of the button (position size etc.) now go to the designer file again and see how the code is changed, without you having to do it.
Most of the time I use VS C# 2008 Express. Under the build menu you will find a Publish option. Use it and see what happens. Happy computing!
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
•
•
Join Date: Jul 2009
Posts: 129
Reputation:
Solved Threads: 11
1
#6 Nov 2nd, 2009
•
•
•
•
Thanks for the reply...Is there any use with this designer.cs file Visual Studio.What if i delete this file.
Also what are the files created/required when try to publish a program to executable .
Whatever designing you do ,for that code is generated in designer.cs file.Like you have a picturebox and a panel on your form then the code for these two components will be in generated in designer.cs file automatically as you drag them on your form.The code which is automatically generated for these is:
C# Syntax (Toggle Plain Text)
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.PictureBox pictureBox1;
And if you delete this file it will create no problem but all the coding (for varoius components of toolbox),you have to include in .cs file.......
And most of the coders do this only..........
They do not include designer.cs file,instead they code for all components of toolbox ..........
•
•
Join Date: Oct 2009
Posts: 37
Reputation:
Solved Threads: 3
0
#8 Nov 2nd, 2009
Is it "better" to programmatically create form objects at run time or is it better to use the IDE tool box to drag items onto the form?? For example I made a project that had 27 buttons. I decided to create all 27 of them at run time with a for loop instead of manually creating them with the toolbox and used one method to handle all the clicks. Is it better to dynamically create buttons or is it better practice to create form widgets with the tool box?
![]() |
Similar Threads
- Web Designer / Graphic Designer Needed (Web Development Job Offers)
- Senior Web Designer (Web Development Job Offers)
- Need Web Designer for Internet Travel Website (Web Development Job Offers)
- New Web Designer Job Opening at Westville Studio (Web Development Job Offers)
- Flash Developer/Designer Job Opportunity (Web Development Job Offers)
- Flash Developer/Designer Job Opportunity (Web Development Job Offers)
- Seeking experienced web/graphic designer - hourly work - Northwest Chicago suburbs (Web Development Job Offers)
- Wanted ASAP Web Developer / UI Designer (Web Development Job Offers)
- Experienced Web Graphic Designer w Work Examples (Web Development Job Offers)
Other Threads in the C# Forum
- Previous Thread: hi..
- Next Thread: Big Numbers Problem
Views: 375 | Replies: 8
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development drawing encryption enum event excel file files form format ftp function gdi+ http httpwebrequest image index input install java label list listbox login mandelbrot math mouseclick mysql networking object oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view webbrowser windows winforms wpf xml






