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.
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.
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!
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:
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 ..........
thank you for the reply
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?
Please RunTimeError post your question again in a new thread!!!
Solved threads are not intended to continue with another subject.
The file which contains the layout information.
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...