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 / .NET Framework / Compact Framework / April 2006

Tip: Looking for answers? Try searching our database.

TabPage, Panel, and AutoScaleMode

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan - 11 Mar 2006 17:01 GMT
This is to redirect my earlier question about the designer and .NET CF 2.0.

I've found out more.

It seems that the trouble is that the Panel Control and TabPage Control
don't respond to AutoScaleMode. In fact, they behave quite unpredictably in
the designer.

Looking at the hierarchy, it is apparent that Panel and TabPage inherit from
Scrollable Control, and not ContainerControl. Not sure why, since they are
definitely containers for other controls.

I can't be the only one who has run into this. What is a suitable
workaround? Is there a control I should use that is like a Panel, but has
the important AutoScaleMode property? Non of the descendents seem to be in
the toolbar.

Maybe a custom control is what you'll suggest. I don't want to reinvent the
wheel, so if it has already been solved, I want to learn from that.

Nathan
Nathan - 13 Mar 2006 20:08 GMT
For future generations, I am posting the steps I've taken

Editing the code to replace all instances of Panel with an instance of user
control will cause them to work correctly. The steps are
1. Set form's AutoScaleMode = dpi
2. Edit code to replace Panel with UserControl. (UserControl won't show up
in the toolbox, at least for me.)

Fixing Tabpages was a bit more complex.
1. Set form's AutoScaleMode = dpi
2. Set tabControl's Dock=Fill (could depend on your tabpage's location.
3. Change to VGA mode. The controls in the tabpages will not scale up,
giving you more room to work. 4. Create a Panel in the empty space of a
tabpage
5. Select all controls from the tabpage and place them into the Panel,
maintaining their relative position.
6. Set the Panel's Dock=Fill
7. Repeat steps 4-6 for all tabpages.
8. Edit the code, replacing all instances of Panel with UserControl.

Doing this for a brand new form may not be so cumbersome, but you should
remember to add a UserControl to each TabPage before placing anything on/in
it.

Nathan
Sachin Palewar - 10 Apr 2006 12:56 GMT
So did you coded a usercontrol behaving like panel??
Nathan - 30 Apr 2006 04:15 GMT
> So did you coded a usercontrol behaving like panel??

No. I just used UserControl straight and it seems to behave like Panel.

Nathan

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.