WinForms Designer Prob: Change control Location at design time

G

Gunnar

Hi,

I am implementing a windows form designer that is based upon the
designer sample from microsoft
(http://support.microsoft.com/?id=813808). The problem that I have is
that i would like to change the size and location of a certain control
when I drop it on the form.

In the IContainer.Add method of the DesignerHost I am able to change
the size of the control that is to be added but I am unable to change
the location of it, e.g. set it to the top. I change the properties
like this:

if(component is Panel)
{
(component as Panel).Size = new Size(10, 10);
(component as Panel).Locaton = new Point(8, 8);
}

Does anybody know why I am able to change the size but not the location
of the control?

cheers,

gunnar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top