473,378 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

CWinFormsView has arbitrary minimum size?

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

Aug 10 '06 #1
1 1787
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::ScrollableCon trol^>(GetControl());
if (scrlCtrl != nullptr)
{
CRect rcView;
GetClientRect(&rcView);
System::Drawing::Size size(0,0);
scrlCtrl->AutoScrollMinSize = size;
}
// *** End workaround

Aug 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Adam H. Peterson | last post by:
Is there a standard way to find the minimum value for a data type? I'm thinking along the lines of std::numeric_limits<T>::min(). But that doesn't work for floating point types. I can't use...
3
by: Harry_Crow | last post by:
I want to restrict the minimum size of the form. I find that there are properties MaximumSize and MinimumSize. This will help you control the maximum and minimum size the form, when the form is...
1
by: Patrick Dunnigan | last post by:
Hi, I am attempting a bulk copy from a c program into SQL Server 2000 using DBLib in freeTDS 0.63 RC11 (gcc 3.4.3, RH 9). I am getting an error message that I cannot find any documentation on. ...
12
by: David Sworder | last post by:
Hi, I'm writing an application in which a client (C#/WinForms) and server (C#/service) interact with one another. The client establishes a "session" with the server but for scalability reasons...
1
by: Wilfried Mestdagh | last post by:
Hi, If you doubleclick on a dbgrid title separator the column automticly resize to his minumum width. How to do this in code ? -- rgds, Wilfried http://www.mestdagh.biz
1
by: MLM450 | last post by:
I am trying to use CWinFormsView. I have followed the instructions in the Microsoft article on changing a CView based class to use it. However, when I compile I get this message: fatal error...
2
by: =?Utf-8?B?Qm9iIFdhaXRl?= | last post by:
I have produced a small exe (1.6mb) which doesnt have any file access and doesnt have very heavy memory requirements. It was created in Visual Studio 2005. How would I go about calculating the...
158
by: jty0734 | last post by:
i don't know what input size of string is. so i can't gets inputsize before malloc function. i want determine the size of malloc without get inputsize in advance. how to deal with it?
36
by: James Harris | last post by:
Initial issue: read in an arbitrary-length piece of text. Perceived issue: handle variable-length data The code below is a suggestion for implementing a variable length buffer that could be used...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.