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 Controls / December 2006

Tip: Looking for answers? Try searching our database.

How does a container constrain its child controls to specific bounds?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anthony Paul - 08 Dec 2006 20:19 GMT
Hello everyone!

I have sub-classed the Panel class in order to create a header region
on the top which is userdrawn. However, I have yet to figure out how to
limit a child control from being placed on top of the area of my panel
on which the header is being drawn. DockPadding.Top or Padding.Top
seems to work only if the child control is docked to it.

I saw the TabControl and I would love to know how they managed to
create the tabs section where that entire top region where the tab
buttons are drawn is off-limits to child controls. The tab page area is
the only place where the child controls can be placed, and this is very
similar to the type of functionality I need.

So to sum it all up, I need a way to limit my child controls range to
one that my container specifies, whether it's docked or not.

I appreciate your help in advance, thank you for your time.

Cheers!

Anthony
gourmete - 11 Dec 2006 21:49 GMT
Hi!

Why don?t you create a simple user-control? Put one panel on it for
the header and one for the content and your are done. Or am I wrong?
Anthony Paul - 12 Dec 2006 02:20 GMT
Hello!

Thanks for replying, and yes, this is definitely a very simple
alternative! However, I'm not a big fan of wasting resources when more
efficient methods are possible. In other words, if it's possible to
accomplish what I want in one control then I don't mind putting in the
extra effort that it may require.

Thanks!

Anthony

> Hi!
>
> Why don´t you create a simple user-control? Put one panel on it for
> the header and one for the content and your are done. Or am I wrong?

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.