So what is the overall goal of the control? Have you tried creating a
UserControl, instead of inheriting from Control, and using the designer to
create your control? This can be done by creating a "Windows Control
Library" project. Below, I have created a UserControl that contains a
ComboBox that is fixed to the bottom-left corner. I have tested this control
in a Windows Forms application as well as embedded in a web page and it
works as expected. I am using Windows 2000 Pro, VS.Net 2003 w/ .Net Fx 1.1
SP1, IE 6.
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace WindowsControlLibrary1
{
public class UserControl1 : System.Windows.Forms.UserControl
{
private System.Windows.Forms.ComboBox comboBox1;
public UserControl1()
{
InitializeComponent();
this.comboBox1.Location = new Point(0, (this.Height -
this.comboBox1.Size.Height));
this.comboBox1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.Font = new System.Drawing.Font("Arial", 27.75F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
this.comboBox1.Location = new System.Drawing.Point(8, 8);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(72, 50);
this.comboBox1.TabIndex = 0;
//
// UserControl1
//
this.Controls.Add(this.comboBox1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(100, 100);
this.ResumeLayout(false);
}
#endregion
}
}

Signature
Tim Wilson
.Net Compact Framework MVP
> Hi,
>
[quoted text clipped - 27 lines]
>
> Hope you will find where is problem ...
B.J. - 18 Feb 2005 19:15 GMT
I could use it so, but still can't understand why it does not work for
control ...
Thank you for your comments.
> So what is the overall goal of the control? Have you tried creating a
> UserControl, instead of inheriting from Control, and using the designer to
[quoted text clipped - 93 lines]
> >
> > Hope you will find where is problem ...
Tim Wilson - 18 Feb 2005 19:31 GMT
So did the UserControl work as expected? It should work for Control if you
really wanted it to. Try deriving the UserControl1 class, that I posted,
from System.Windows.Forms.Control and see if it works. So change this line
(public class UserControl1 : System.Windows.Forms.UserControl) to be this
line (public class UserControl1 : System.Windows.Forms.Control).

Signature
Tim Wilson
.Net Compact Framework MVP
> I could use it so, but still can't understand why it does not work for
> control ...
[quoted text clipped - 98 lines]
> > >
> > > Hope you will find where is problem ...
B.J. - 19 Feb 2005 16:27 GMT
When I comment
this.comboBox1.Size = new System.Drawing.Size(72, 50);
it does not work neither for : UserControl.
> So did the UserControl work as expected? It should work for Control if you
> really wanted it to. Try deriving the UserControl1 class, that I posted,
[quoted text clipped - 108 lines]
> > > >
> > > > Hope you will find where is problem ...
Tim Wilson - 19 Feb 2005 17:24 GMT
This probably has to do with the ComboBox getting set to a default size at
some point in it's creation process. So you can either explicitly set a Size
or you can move the code that is used to set the Location into an OnResize
override for the UserControl. So add this method to the UserControl1 class.
protected override void OnResize ( System.EventArgs e )
{
this.comboBox1.Location = new Point(0, (this.Height -
this.comboBox1.Size.Height));
base.OnResize(e);
}

Signature
Tim Wilson
.Net Compact Framework MVP
> When I comment
> this.comboBox1.Size = new System.Drawing.Size(72, 50);
[quoted text clipped - 112 lines]
> > > > >
> > > > > Hope you will find where is problem ...