473,749 Members | 2,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1811
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::Scroll ableControl ^scrlCtrl =
dynamic_cast<Sy stem::Windows:: Forms::Scrollab leControl^>(Get Control());
if (scrlCtrl != nullptr)
{
CRect rcView;
GetClientRect(& rcView);
System::Drawing ::Size size(0,0);
scrlCtrl->AutoScrollMinS ize = 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
5369
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 (-std::numeric_limits<T>::max()) either, because that won't work for unsigned types (and technically won't work for signed integer types and others either, although it would probably be "good enough" for them). Do I need to implement a new template...
3
2151
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 resized. but I find using this will make the controls on the form to flicker more. one can even restrict using WM_SIZING message but the position of the window is changing slowly while doing so. does anyone know the logic how the window minimum size...
1
6379
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. The server is sending back the following: "Received invalid row length 2 from bcp client. Minimum row size is 4." I know the row is longer 2 bytes (see below). Once this happened I created a
12
16912
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 there is not a one to one map between a session and a physical TCP connection. A client may disconnect the TCP connection if it is idle for more than 60 seconds... yet a conceptual "session" may last for days at a time. It's necessary that the...
1
1604
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
3861
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 C1189: #error : MFC WinForms support requires /clr (doesn't support oldSyntax) But I have the CLR switch set to "Common Language Runtime Support (/clr)" so what's the problem?
2
2980
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 minimum windows version and hardware configuration (processor speed, ram size, disk size) ?
158
6140
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
3808
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 to read text or handle arrays of arbitrary length. I don't have the expertise in C of many folks here so I feel like I'm offering a small furry animal for sacrifice to a big armour plated one... but will offer it anyway. Please do suggest...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.