What is designer.cs?

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jun 2009
Posts: 19
Reputation: george_82 is an unknown quantity at this point 
Solved Threads: 0
george_82 george_82 is offline Offline
Newbie Poster

What is designer.cs?

 
0
  #1
24 Days Ago
Hello All,

Can somebody tell me what is designer.cs file in C# and what is its use in programming. I'm new in C# and I also want to know more about this automatically created designer.cs file while programming.

Thanks,

George
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,187
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 571
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast
 
0
  #2
24 Days Ago
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.
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,917
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 274
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso
 
0
  #3
24 Days Ago
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.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 19
Reputation: george_82 is an unknown quantity at this point 
Solved Threads: 0
george_82 george_82 is offline Offline
Newbie Poster
 
0
  #4
24 Days Ago
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 .
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,917
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 274
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso
 
0
  #5
24 Days Ago
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!
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 117
Reputation: vinnijain is an unknown quantity at this point 
Solved Threads: 10
vinnijain vinnijain is offline Offline
Junior Poster
 
1
  #6
24 Days Ago
Originally Posted by george_82 View Post
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:
  1. private System.Windows.Forms.Panel panel1;
  2. 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 ..........
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 19
Reputation: george_82 is an unknown quantity at this point 
Solved Threads: 0
george_82 george_82 is offline Offline
Newbie Poster
 
0
  #7
24 Days Ago
thank you for the reply
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 31
Reputation: RunTimeError is an unknown quantity at this point 
Solved Threads: 3
RunTimeError RunTimeError is offline Offline
Light Poster
 
0
  #8
24 Days Ago
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?
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,917
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 274
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso
 
0
  #9
24 Days Ago
Please RunTimeError post your question again in a new thread!!!
Solved threads are not intended to continue with another subject.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC