change location of control

G

Guest

Hi all,
I have a form that inherits from another form.
I want to change the location of a specific control. For this I have a
method in the base form which does only this:
public virtual void SetLocation(int x, int y)
{
myControl.Location = new Point(x, y);
}
I call this method from the inheriting form, like this: base.SetLocation(0,
0);

It doesn't work. The control's location changes but not to (0,0).
When I call this method from inside the base form it does work(changes to
0,0).
It looks like the inheriting form can't touch some certain area.

Can anybody explain to me what may cause this issue, and how to solve it?
Thank you very much
 
K

Kevin Spencer

The location of the Control is always relative to its container Control.
Could this be the problem?

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
G

Guest

Thanks Kevin,
yes, I know that, but still don't know what happens here.
when reducing the size of the control, it succeeds.
It's probably something I made wrong with inheritance...
thanks anyway
 

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