Designer generated code....too wordy !

Designer generated code....too wordy !

Post by Doppl » Fri, 26 Jul 2002 07:35:17



The form designer generates code like...
private System.Windows.Forms.MenuItem menuTreeEdit;

when you have...

"using  System.Windows.Forms"

placed at the top of the source file then

"private MenuItem menuTreeEdit"

will do fine. Is there a way of telling the designer to generate code using
the shorthand way ?

Cheers

Neil

 
 
 

1. Event handler code dissapears from 'Web Form Designer generated code'

Why does the VS7 IDE remove code from the 'private void
InitializeComponent()' function in the '#region Web Form Designer generated
code'???

This is a sporatic problem and it doesn't make sense...  the designer puts
the code in there for you at design time to fire the events, and then
sometimes it decides to remove it for you...

This is how it should STAY:
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
 //
 // CODEGEN: This call is required by the ASP.NET Web Form Designer.
 //
 InitializeComponent();
 base.OnInit(e);

///  Required method for Designer support - do not modify
///  the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
 this.cmdSave.Click += new System.EventHandler(this.cmdSave_Click);
 this.Load += new System.EventHandler(this.Page_Load);
#endregion

This is what happens SOMETIMES:
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
 //
 // CODEGEN: This call is required by the ASP.NET Web Form Designer.
 //
 InitializeComponent();
 base.OnInit(e);

///  Required method for Designer support - do not modify
///  the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{

#endregion

2. How can I print from Acrobat to an imagesetter

3. Task list build errors for Form Designer generated code?

4. Emulateur C64...

5. Designer generated code for controls in forms

6. Dice text ed?

7. Windows Form Designer generated code

8. Wanted: 1MB AGNUS

9. Windows Form Designer Generated Code Region questions

10. Suggestion: the form generator should place the dispose in the windows form designer generated code region

11. Writing Custom designers / editors for CF / Access Controls.AddRange in Designer/Editor code not possible?

12. How do you remove a Designer attribute and how do you debug designer code?