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 / April 2006

Tip: Looking for answers? Try searching our database.

User control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pesso - 29 Apr 2006 08:39 GMT
I have a user control in which contains a Label, a Toolbar and a TabControl.
When the User control is resized I like to resize the controls inside the
User control. How do I do that?

Signature

pesso

Robotics
http://www.robotics.com/robots.html

C++ to HTML Converter
http://www.codesolutions.net

andrej.tozon@gmail.com - 29 Apr 2006 09:41 GMT
Set the Anchor property of the controls you want to resize withing the
parent user control.
Michael Powell - 29 Apr 2006 13:46 GMT
Hi,
If you want all of your controls to resize you can set their sizes in the
OnSizeChanged method, you should set their sizes to a percentage of the
ClientRectangle, this means that they will always be proportionately the
same.

The problem with using the anchors is that it uses Rectangles so its always
an integer value so you get ugly jerking resizing of your controls, you
should also turn off the SnapToGrid property

Note:  You should define where you want them by calculating RectangleF s and
then set the rectangle for each of your controls to one of these
RectangleF's

Signature

Mike Powell
Ramuseco Limited
www.ramuseco.com

> Set the Anchor property of the controls you want to resize withing the
> parent user control.

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.