473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Fliker and UserControl

Hi !

I've developed a small UserControl with five textbox and label.
However, when I want to display the UserControl in a form, controls
appear slowly one after one. I've activated double buffering and
removed all code in the OnLoad, constructor and I still have the same
problem.
Here is the code that I use to display the UserControl un the form

_objContainer.SuspendLayout();
_objContainer.Controls.Clear();
_objContainer.Controls.Add(_objUserControl);
_objContainer.ResumeLayout(false);

How can I resolve this problem? Thanks for your help!

Martin

Dec 11 '06 #1
3 1989
Hi Martin,

You might want to post the code for the UserControl instead.

--
Dave Sexton

"Martin" <ma*********@gmail.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Hi !

I've developed a small UserControl with five textbox and label.
However, when I want to display the UserControl in a form, controls
appear slowly one after one. I've activated double buffering and
removed all code in the OnLoad, constructor and I still have the same
problem.
Here is the code that I use to display the UserControl un the form

_objContainer.SuspendLayout();
_objContainer.Controls.Clear();
_objContainer.Controls.Add(_objUserControl);
_objContainer.ResumeLayout(false);

How can I resolve this problem? Thanks for your help!

Martin

Dec 11 '06 #2
Hi!

Here some important part of the code in the UserControl... Thanks for
your help ! Maybe it's because I use a TableLayoutPanel ?

public AddressUC()
{
this.SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer, true);

InitializeComponent();
}

private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.tableLayoutPanel1 = new
System.Windows.Forms.TableLayoutPanel();
this.txtStreet = new System.Windows.Forms.TextBox();
this.txtCity = new System.Windows.Forms.TextBox();
this.ddlState = new
EmpireOne.ClearSky.Presentation.Controls.ComboBoxS tate();
this.ddlCountry = new
EmpireOne.ClearSky.Presentation.Controls.ComboBoxC ountry();
this.txtPostalCode = new System.Windows.Forms.TextBox();
this.lblStreet = new System.Windows.Forms.Label();
this.lblCity = new System.Windows.Forms.Label();
this.lblStateProvince = new System.Windows.Forms.Label();
this.lblPostalCode = new System.Windows.Forms.Label();
this.lblCountry = new System.Windows.Forms.Label();
this.errorProvider = new
System.Windows.Forms.ErrorProvider(this.components );
this.tableLayoutPanel1.SuspendLayout();

((System.ComponentModel.ISupportInitialize)(this.e rrorProvider)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor =
((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Absolute,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.Controls.Add(this.txtStreet , 1, 2);
this.tableLayoutPanel1.Controls.Add(this.txtCity, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.ddlState, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.ddlCountr y, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.txtPostal Code, 1,
5);
this.tableLayoutPanel1.Controls.Add(this.lblStreet , 0, 2);
this.tableLayoutPanel1.Controls.Add(this.lblCity, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.lblStateP rovince,
0, 4);
this.tableLayoutPanel1.Controls.Add(this.lblPostal Code, 0,
5);
this.tableLayoutPanel1.Controls.Add(this.lblCountr y, 0, 1);
this.tableLayoutPanel1.Location = new
System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new
System.Windows.Forms.Padding(0, 3, 0, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 6;
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms .SizeType.Absolute,
15F));
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(618,
165);
this.tableLayoutPanel1.TabIndex = 0;
//
// txtStreet
//
this.txtStreet.Dock = System.Windows.Forms.DockStyle.Fill;
this.errorProvider.SetIconAlignment(this.txtStreet ,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.txtStreet.Location = new System.Drawing.Point(103,
45);
this.txtStreet.MinimumSize = new System.Drawing.Size(4,
26);
this.txtStreet.Multiline = true;
this.txtStreet.Name = "txtStreet";
this.txtStreet.ScrollBars =
System.Windows.Forms.ScrollBars.Vertical;
this.txtStreet.Size = new System.Drawing.Size(512, 32);
this.txtStreet.TabIndex = 1;
//
// txtCity
//
this.txtCity.Dock = System.Windows.Forms.DockStyle.Fill;
this.errorProvider.SetIconAlignment(this.txtCity,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.txtCity.Location = new System.Drawing.Point(103, 83);
this.txtCity.Name = "txtCity";
this.txtCity.Size = new System.Drawing.Size(512, 20);
this.txtCity.TabIndex = 2;
//
// ddlState
//
this.ddlState.Dock = System.Windows.Forms.DockStyle.Fill;
this.ddlState.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ddlState.FormattingEnabled = true;
this.errorProvider.SetIconAlignment(this.ddlState,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.ddlState.Location = new System.Drawing.Point(103,
109);
this.ddlState.Name = "ddlState";
this.ddlState.Size = new System.Drawing.Size(512, 21);
this.ddlState.TabIndex = 3;
//
// ddlCountry
//
this.ddlCountry.ComboBoxState = this.ddlState;
this.ddlCountry.Dock = System.Windows.Forms.DockStyle.Fill;
this.ddlCountry.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ddlCountry.FormattingEnabled = true;
this.errorProvider.SetIconAlignment(this.ddlCountr y,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.ddlCountry.Location = new System.Drawing.Point(103,
18);
this.ddlCountry.Name = "ddlCountry";
this.ddlCountry.Size = new System.Drawing.Size(512, 21);
this.ddlCountry.TabIndex = 0;
//
// txtPostalCode
//
this.txtPostalCode.Dock =
System.Windows.Forms.DockStyle.Fill;
this.errorProvider.SetIconAlignment(this.txtPostal Code,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.txtPostalCode.Location = new System.Drawing.Point(103,
136);
this.txtPostalCode.Name = "txtPostalCode";
this.txtPostalCode.Size = new System.Drawing.Size(512, 20);
this.txtPostalCode.TabIndex = 4;
//
// lblStreet
//
this.lblStreet.AutoSize = true;
this.lblStreet.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblStreet.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblStreet.Location = new System.Drawing.Point(3, 42);
this.lblStreet.Name = "lblStreet";
this.lblStreet.Size = new System.Drawing.Size(94, 38);
this.lblStreet.TabIndex = 0;
this.lblStreet.Text = "lblStreet";
this.lblStreet.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// lblCity
//
this.lblCity.AutoSize = true;
this.lblCity.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblCity.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblCity.Location = new System.Drawing.Point(3, 80);
this.lblCity.Name = "lblCity";
this.lblCity.Size = new System.Drawing.Size(94, 26);
this.lblCity.TabIndex = 0;
this.lblCity.Text = "lblCity";
this.lblCity.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// lblStateProvince
//
this.lblStateProvince.AutoSize = true;
this.lblStateProvince.Dock =
System.Windows.Forms.DockStyle.Fill;
this.lblStateProvince.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblStateProvince.Location = new
System.Drawing.Point(3, 106);
this.lblStateProvince.Name = "lblStateProvince";
this.lblStateProvince.Size = new System.Drawing.Size(94,
27);
this.lblStateProvince.TabIndex = 0;
this.lblStateProvince.Text = "lblStateProvince";
this.lblStateProvince.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// lblPostalCode
//
this.lblPostalCode.AutoSize = true;
this.lblPostalCode.Dock =
System.Windows.Forms.DockStyle.Fill;
this.lblPostalCode.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblPostalCode.Location = new System.Drawing.Point(3,
133);
this.lblPostalCode.Name = "lblPostalCode";
this.lblPostalCode.Size = new System.Drawing.Size(94, 32);
this.lblPostalCode.TabIndex = 0;
this.lblPostalCode.Text = "lblPostalCode";
this.lblPostalCode.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// lblCountry
//
this.lblCountry.AutoSize = true;
this.lblCountry.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblCountry.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblCountry.Location = new System.Drawing.Point(3, 15);
this.lblCountry.Name = "lblCountry";
this.lblCountry.Size = new System.Drawing.Size(94, 27);
this.lblCountry.TabIndex = 0;
this.lblCountry.Text = "lblCountry";
this.lblCountry.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// errorProvider
//
this.errorProvider.ContainerControl = this;
//
// AddressUC
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F,
13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tableLayoutPanel1);
this.DoubleBuffered = true;
this.Name = "AddressUC";
this.Size = new System.Drawing.Size(618, 176);
this.HandleDestroyed += new
System.EventHandler(this.AddressUC_HandleDestroyed );
this.Load += new System.EventHandler(this.AddressUC_Load);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();

((System.ComponentModel.ISupportInitialize)(this.e rrorProvider)).EndInit();
this.ResumeLayout(false);

}
Dave Sexton wrote:
Hi Martin,

You might want to post the code for the UserControl instead.

--
Dave Sexton

"Martin" <ma*********@gmail.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Hi !

I've developed a small UserControl with five textbox and label.
However, when I want to display the UserControl in a form, controls
appear slowly one after one. I've activated double buffering and
removed all code in the OnLoad, constructor and I still have the same
problem.
Here is the code that I use to display the UserControl un the form

_objContainer.SuspendLayout();
_objContainer.Controls.Clear();
_objContainer.Controls.Add(_objUserControl);
_objContainer.ResumeLayout(false);

How can I resolve this problem? Thanks for your help!

Martin
Dec 11 '06 #3
Hi Martin,

You haven't posted enough code for me to reproduce the issue, but you
shouldn't just go ahead and post the rest of it either. You should try to
reduce the problem as much as possible by removing controls and code until
the problem goes away or the UserControl is at its simplest yet, and if you
haven't figured it out by then, post a short but complete sample (see Jon
Skeet's article for guidance:
http://www.yoda.arachsys.com/csharp/complete.html).

In the code you have posted you haven't included some things that may very
well be the cause of your issue. I can't reproduce the following:

1. HandleDestroyed event handler code
2. Load event handler code
3. ddlState custom control
4. ddlCountry custom UserControl
5. ddlCountry.ComboBoxState = ddlState

In VS 2005, I placed your code in an empty UserControl without the event
handlers and I changed both ddlState and ddlCountry to be normal ComboBox
controls (also removing the assignment of ddlState to the
ddlCountry.ComboBoxState property). I placed the control on an empty Form
and showed it at the start of the application. The control loaded fine.

To debug this problem, try removing all five of the above points first and
see if the problem goes away, add each back again one at a time until you
can narrow down the problem.

HTH

--
Dave Sexton

"Martin" <ma*********@gmail.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
Hi!

Here some important part of the code in the UserControl... Thanks for
your help ! Maybe it's because I use a TableLayoutPanel ?

public AddressUC()
{
this.SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer, true);

InitializeComponent();
}

private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.tableLayoutPanel1 = new
System.Windows.Forms.TableLayoutPanel();
this.txtStreet = new System.Windows.Forms.TextBox();
this.txtCity = new System.Windows.Forms.TextBox();
this.ddlState = new
EmpireOne.ClearSky.Presentation.Controls.ComboBoxS tate();
this.ddlCountry = new
EmpireOne.ClearSky.Presentation.Controls.ComboBoxC ountry();
this.txtPostalCode = new System.Windows.Forms.TextBox();
this.lblStreet = new System.Windows.Forms.Label();
this.lblCity = new System.Windows.Forms.Label();
this.lblStateProvince = new System.Windows.Forms.Label();
this.lblPostalCode = new System.Windows.Forms.Label();
this.lblCountry = new System.Windows.Forms.Label();
this.errorProvider = new
System.Windows.Forms.ErrorProvider(this.components );
this.tableLayoutPanel1.SuspendLayout();

((System.ComponentModel.ISupportInitialize)(this.e rrorProvider)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor =
((System.Windows.Forms.AnchorStyles)(((System.Wind ows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Absolute,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.ColumnStyles.Add(new
System.Windows.Forms.ColumnStyle(System.Windows.Fo rms.SizeType.Percent,
100F));
this.tableLayoutPanel1.Controls.Add(this.txtStreet , 1, 2);
this.tableLayoutPanel1.Controls.Add(this.txtCity, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.ddlState, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.ddlCountr y, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.txtPostal Code, 1,
5);
this.tableLayoutPanel1.Controls.Add(this.lblStreet , 0, 2);
this.tableLayoutPanel1.Controls.Add(this.lblCity, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.lblStateP rovince,
0, 4);
this.tableLayoutPanel1.Controls.Add(this.lblPostal Code, 0,
5);
this.tableLayoutPanel1.Controls.Add(this.lblCountr y, 0, 1);
this.tableLayoutPanel1.Location = new
System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new
System.Windows.Forms.Padding(0, 3, 0, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 6;
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle(System.Windows.Forms .SizeType.Absolute,
15F));
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new
System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(618,
165);
this.tableLayoutPanel1.TabIndex = 0;
//
// txtStreet
//
this.txtStreet.Dock = System.Windows.Forms.DockStyle.Fill;
this.errorProvider.SetIconAlignment(this.txtStreet ,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.txtStreet.Location = new System.Drawing.Point(103,
45);
this.txtStreet.MinimumSize = new System.Drawing.Size(4,
26);
this.txtStreet.Multiline = true;
this.txtStreet.Name = "txtStreet";
this.txtStreet.ScrollBars =
System.Windows.Forms.ScrollBars.Vertical;
this.txtStreet.Size = new System.Drawing.Size(512, 32);
this.txtStreet.TabIndex = 1;
//
// txtCity
//
this.txtCity.Dock = System.Windows.Forms.DockStyle.Fill;
this.errorProvider.SetIconAlignment(this.txtCity,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.txtCity.Location = new System.Drawing.Point(103, 83);
this.txtCity.Name = "txtCity";
this.txtCity.Size = new System.Drawing.Size(512, 20);
this.txtCity.TabIndex = 2;
//
// ddlState
//
this.ddlState.Dock = System.Windows.Forms.DockStyle.Fill;
this.ddlState.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ddlState.FormattingEnabled = true;
this.errorProvider.SetIconAlignment(this.ddlState,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.ddlState.Location = new System.Drawing.Point(103,
109);
this.ddlState.Name = "ddlState";
this.ddlState.Size = new System.Drawing.Size(512, 21);
this.ddlState.TabIndex = 3;
//
// ddlCountry
//
this.ddlCountry.ComboBoxState = this.ddlState;
this.ddlCountry.Dock = System.Windows.Forms.DockStyle.Fill;
this.ddlCountry.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ddlCountry.FormattingEnabled = true;
this.errorProvider.SetIconAlignment(this.ddlCountr y,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.ddlCountry.Location = new System.Drawing.Point(103,
18);
this.ddlCountry.Name = "ddlCountry";
this.ddlCountry.Size = new System.Drawing.Size(512, 21);
this.ddlCountry.TabIndex = 0;
//
// txtPostalCode
//
this.txtPostalCode.Dock =
System.Windows.Forms.DockStyle.Fill;
this.errorProvider.SetIconAlignment(this.txtPostal Code,
System.Windows.Forms.ErrorIconAlignment.MiddleLeft );
this.txtPostalCode.Location = new System.Drawing.Point(103,
136);
this.txtPostalCode.Name = "txtPostalCode";
this.txtPostalCode.Size = new System.Drawing.Size(512, 20);
this.txtPostalCode.TabIndex = 4;
//
// lblStreet
//
this.lblStreet.AutoSize = true;
this.lblStreet.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblStreet.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblStreet.Location = new System.Drawing.Point(3, 42);
this.lblStreet.Name = "lblStreet";
this.lblStreet.Size = new System.Drawing.Size(94, 38);
this.lblStreet.TabIndex = 0;
this.lblStreet.Text = "lblStreet";
this.lblStreet.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// lblCity
//
this.lblCity.AutoSize = true;
this.lblCity.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblCity.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblCity.Location = new System.Drawing.Point(3, 80);
this.lblCity.Name = "lblCity";
this.lblCity.Size = new System.Drawing.Size(94, 26);
this.lblCity.TabIndex = 0;
this.lblCity.Text = "lblCity";
this.lblCity.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// lblStateProvince
//
this.lblStateProvince.AutoSize = true;
this.lblStateProvince.Dock =
System.Windows.Forms.DockStyle.Fill;
this.lblStateProvince.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblStateProvince.Location = new
System.Drawing.Point(3, 106);
this.lblStateProvince.Name = "lblStateProvince";
this.lblStateProvince.Size = new System.Drawing.Size(94,
27);
this.lblStateProvince.TabIndex = 0;
this.lblStateProvince.Text = "lblStateProvince";
this.lblStateProvince.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// lblPostalCode
//
this.lblPostalCode.AutoSize = true;
this.lblPostalCode.Dock =
System.Windows.Forms.DockStyle.Fill;
this.lblPostalCode.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblPostalCode.Location = new System.Drawing.Point(3,
133);
this.lblPostalCode.Name = "lblPostalCode";
this.lblPostalCode.Size = new System.Drawing.Size(94, 32);
this.lblPostalCode.TabIndex = 0;
this.lblPostalCode.Text = "lblPostalCode";
this.lblPostalCode.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// lblCountry
//
this.lblCountry.AutoSize = true;
this.lblCountry.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblCountry.ImeMode =
System.Windows.Forms.ImeMode.NoControl;
this.lblCountry.Location = new System.Drawing.Point(3, 15);
this.lblCountry.Name = "lblCountry";
this.lblCountry.Size = new System.Drawing.Size(94, 27);
this.lblCountry.TabIndex = 0;
this.lblCountry.Text = "lblCountry";
this.lblCountry.TextAlign =
System.Drawing.ContentAlignment.MiddleLeft;
//
// errorProvider
//
this.errorProvider.ContainerControl = this;
//
// AddressUC
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F,
13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tableLayoutPanel1);
this.DoubleBuffered = true;
this.Name = "AddressUC";
this.Size = new System.Drawing.Size(618, 176);
this.HandleDestroyed += new
System.EventHandler(this.AddressUC_HandleDestroyed );
this.Load += new System.EventHandler(this.AddressUC_Load);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();

((System.ComponentModel.ISupportInitialize)(this.e rrorProvider)).EndInit();
this.ResumeLayout(false);

}
Dave Sexton wrote:
>Hi Martin,

You might want to post the code for the UserControl instead.

--
Dave Sexton

"Martin" <ma*********@gmail.comwrote in message
news:11**********************@j44g2000cwa.googleg roups.com...
Hi !

I've developed a small UserControl with five textbox and label.
However, when I want to display the UserControl in a form, controls
appear slowly one after one. I've activated double buffering and
removed all code in the OnLoad, constructor and I still have the same
problem.
Here is the code that I use to display the UserControl un the form

_objContainer.SuspendLayout();
_objContainer.Controls.Clear();
_objContainer.Controls.Add(_objUserControl);
_objContainer.ResumeLayout(false);

How can I resolve this problem? Thanks for your help!

Martin

Dec 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Raed Sawalha | last post by:
Hi, I have a strange problem with a usercontrol on a page. The usercontrol dispalyes three categories (From a database) when the user clicks a category they see all the products in a shop for...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
6
by: MeowCow | last post by:
I have created a UserControl that encapsulates a third party data grid. My goal was to create my own DataSource and DataMember properties that forward the binding to the third party grid, then use...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
0
by: Martin | last post by:
Hi ! I've developed a small UserControl with five textbox and label. However, when I want to display the UserControl in a form, controls appear slowly one after one. I've activated double...
4
by: Martin | last post by:
Hi everyone ! For those who haven't read my previous post, I have a problem with a UserControl. When I try to display it on a form, controls seem to appear one after one. In the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.