Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2007

Tip: Looking for answers? Try searching our database.

change location of control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gol - 01 Oct 2007 08:06 GMT
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
Kevin Spencer - 01 Oct 2007 13:23 GMT
The location of the Control is always relative to its container Control.
Could this be the problem?

Signature

HTH,

Kevin Spencer
Microsoft MVP

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

> Hi all,
> I have a form that inherits from another form.
[quoted text clipped - 15 lines]
> Can anybody explain to me what may cause this issue, and how to solve it?
> Thank you very much
gol - 01 Oct 2007 19:18 GMT
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

> The location of the Control is always relative to its container Control.
> Could this be the problem?
[quoted text clipped - 18 lines]
> > Can anybody explain to me what may cause this issue, and how to solve it?
> > Thank you very much

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.