473,385 Members | 2,180 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,385 software developers and data experts.

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 (clientWidthScaleFactor, clientHeightScaleFactor);
does increase the size of the client area so that the scroll bars
appear. Unfortunately, this requires me to do the following
calculation:
float clientHeightScaleFactor = layout_h / (float)(this.Height);
float clientWidthScaleFactor = layout_w / (float)(this.Width);

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 1219

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

Similar topics

3
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...
0
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...
5
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...
0
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...
0
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...
1
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...
0
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...
69
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...
4
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.