473,664 Members | 3,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Increasing client size to accomodate contents (so scroll bars appear)

Hi all, I have a class (call it class A) that extends UserControl
(there is no reason that this couldn't extend Panel). I have a few
PictureBox objects in class A. When I increase the size of the
pictures in the PictureBox objects, I would also like to increase the
window, so that the scroll bars appear. For some reason none of the
following methods force the scroll bars to appear:
this.ClientSize = new Size(layout_w, layout_h);
this.Size = new Size(layout_w, layout_h);;
this.Height = layout_h;
this.Width = layout_w;

However, for some reason:
Scale (clientWidthSca leFactor, clientHeightSca leFactor);
does increase the size of the client area so that the scroll bars
appear. Unfortunately, this requires me to do the following
calculation:
float clientHeightSca leFactor = layout_h / (float)(this.He ight);
float clientWidthScal eFactor = layout_w / (float)(this.Wi dth);

This leads to inaccuracies and will either result in me having to add a
buffer to the above in which case the area of the client window is
almost always too large or almost always undersized. Obviously being
too large is preferable so that the user can actually see the images -
but this is sloppy and a hack.

I would prefer just to tell the client window exactly how large I
expect it to be.

What do I need to do in order to get the client window to increase
according to an absolute specification of height and width?

Thanks,
Novice

Nov 17 '05 #1
0 1230

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

Similar topics

3
16526
by: David Rwj Cherry CS2000 | last post by:
is there any way to disable or lock vertical scroll bars on a browser window? im a newbie and i just don't want them to appear on my screen. sometimes they appear on IE but not on mozilla. any ideas would be most appreciated.
0
2266
by: Axel Dahmen | last post by:
I'm just transcoding my HTML pages from Quirks to Standard mode. Doing so I noticed that whenever a frame's content overflows its frame, TWO scroll bars appear in Standard mode, a vertical and a horizontal one. I understand that the vertical scroll bar hides a part of the body and thus the horizontal scroll bar appears. Nonetheless the horizontal scroll bar appears to be odd from my point of view. Which properties could I possibly set to...
5
3683
by: Aidan | last post by:
Greetings all, I'm trying to build a div based layout for a mambo template (work in progress), and I'm having a strange problem, 2 acctually, with scroll bars in IE. I've tried everything I can think of, but just can't get it to display quite right. It's worth noting that the page displays exactly as intended in Firefox. First Problem:
0
1263
by: Bob Rock | last post by:
Hello, is there a way to first know when a listview displays horizontal and/or vertical scroll bar (maybe an event is fired???) and then to resize the listview to make them disappear??? How much to resize the listview??? ... in other words how much pixels do scroll bars occupy??? Is it possible to discover the scroll bars size dinamically??? Thx.
0
1665
by: Eric | last post by:
I have a TableLayout that I'm having problems with. I am placing controls in it that have scroll bars. When I put enough of them on the control to make the TableLayout's scroll bars appear the scroll bars for the TableLayout cover up my scroll bars for the child controls. When I resize the form it fixes and the child controls are in the appropriate places. This also occurs when the form is maximized and I restore down.
1
1904
by: Karen Hill | last post by:
Hello Access Gurus, I have Access 2000. I created a Form with a Sub-report and that Subreport has a Sub-form. When I expand the Sub-report to show the Sub-form scroll bars appear on the Sub-report so one can view the whole Sub-form. This is how it is supposed to work. Yet, if I expand the Sub-report's most bottom row scroll bars do not appear and consquently the Sub-form is partially hidden! It only happens when trying to expand...
0
1365
by: jojobar | last post by:
We are using the ASP:Menu control (horizontal) for site navigation. The menu is contained by a table with css styles that allows us to give the illusion of a menu bar that runs the entire width of the page. This table also has additional right aligned cells on the same row for such things as logging out. When the child menu items are displayed by the mouse hovering over a menu item, the width of the web page is apparently increasing,...
69
13424
by: RC | last post by:
I know how to do this in JavaScript by window.open("newFile.html", "newTarget", "scrollbars=no,resizable=0,width=200,height=200"); The browser will open a new window size 200x200, not allow resize and no auto horizontal, vertical scrolling bars. I am wonder can I do the similar inside a HTML file like
4
22132
by: Matthew Cox | last post by:
Hi, I've been searching the net all day today trying to figure out how one would accomplish what I originally thought would be a fairly straight forward and simple thing. The problem I'm trying to solve is that the designer would like to limit the total number of entires shown when you click on the drop-down arrow of a select box. I'm starting to think that this isn't possible. I've tried the following with no luck:
0
8437
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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
8861
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7375
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
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
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2764
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1759
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.