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 / Languages / Managed C++ / August 2006

Tip: Looking for answers? Try searching our database.

CWinFormsView has arbitrary minimum size?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MLM450@hotmail.com - 10 Aug 2006 21:05 GMT
I am using CWinFormsView to host my C# control. When I resize the view
window to a larger size the control seems to grow with it just fine.
But when I shrink the size of the view, I get scroll bars. I don't want
scrollbars, I want the control to shrink.

In the .NET control, I have tried adjusting the minimum size and the
auto size mode properties. In my view, I have tried setting the
controls size when the view is resized. None of this has helped.

Any suggestions?

Thanks,
Mike
MLM450@hotmail.com - 11 Aug 2006 16:51 GMT
In case anybody else out there is struggling with this issue too, I
have found the solution. Apparently it is a bug that is not discussed
in the Micorosoft documentation. The only reference I can find on it is
in their CWinFormsView sample app. In OnInitialUpdate, add the
following code after the call to the parent's OnInitialUpdate.

// *** Workaround bottom dock initial sizing issue
System::Windows::Forms::ScrollableControl ^scrlCtrl =
dynamic_cast<System::Windows::Forms::ScrollableControl^>(GetControl());
if (scrlCtrl != nullptr)
{
    CRect rcView;
    GetClientRect(&rcView);
    System::Drawing::Size size(0,0);
    scrlCtrl->AutoScrollMinSize = size;
}
// *** End workaround

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.