Split InitializeComponent()

  • Thread starter Thread starter Phoon Chee Keong
  • Start date Start date
Hi,

Can you please specify what is your exact requirement? By 'split', what
do you mean?

Regards,
Jim
 
Phoon,

I do assume you mean the InitializeComponent method generated by VS.Net
in Asp.Net and Windows forms.

Basically, in ASP.Net, only event handlers are added in
InitializeComponent
e.g.: this.grdProjects.ItemDataBound += new
System.Web.UI.WebControls.DataGridItemEventHandler(this.grdProjects_ItemDataBound);

In Windows forms, controls are initialized, properties set, and event
handlers are added in InitializeComponent.
e.g.:
this.cancelButton = new System.Windows.Forms.Button();
this.cancelButton.Text = "Cancel";
this.cancelButton.Click += new
System.EventHandler(this.CancelButton_Click);

Do you want to split code in InitializeComponent in Asp.Net or Windows
forms? How do you want to split coding? Do you want to split it into
two like
#1. Control initialization and property setting.
#2. Adding event handlers. ?

or into three like
#1. Control initialization
#2. Property setting
#3. Event handlers ?

Regards,
Jim
 
Back
Top