473,473 Members | 1,477 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

AutoSize Issues

I am trying to display several images on a standard Windows Form. Each
image is displayed in a PictureBox control that is 180,130 in size. I
get the Primary Screen size to determine how many images will on one
line of images. I have a form boolean variable that I set to true in
the ClientSizedChanged event handler. In the loop where I am
displaying the images, I check this boolean, and if true, I set the Y
coordinate loop counter to the actual Y location of the last image
placed.

This seems to work OK for the first line of images drawn after the
first client size changed event, but it goes haywirea after that,
drawing each image at some random location on a line, with several
lines since the last image drawn.

It seems unpredictable on just how the client size is adjusted on an
autoscroll generated event.

Any help would be appreciated.
Jun 27 '08 #1
2 1599
On Thu, 01 May 2008 19:33:00 -0700, Joe Cool <jo*****@home.netwrote:
I am trying to display several images on a standard Windows Form. Each
image is displayed in a PictureBox control that is 180,130 in size. I
get the Primary Screen size to determine how many images will on one
line of images. I have a form boolean variable that I set to true in
the ClientSizedChanged event handler. In the loop where I am
displaying the images, I check this boolean, and if true, I set the Y
coordinate loop counter to the actual Y location of the last image
placed.

This seems to work OK for the first line of images drawn after the
first client size changed event, but it goes haywirea after that,
drawing each image at some random location on a line, with several
lines since the last image drawn.

It seems unpredictable on just how the client size is adjusted on an
autoscroll generated event.
The client size shouldn't be changing if all you're doing is scrolling.
As for the rest of your post, I admit it's not really all that clear to me
what you've implemented, or that your approach is actually appropriate for
the goal. However, assuming that what you're trying to do is fill a form
with PictureBox instances, you may want to look at the FlowLayoutPanel
control. You can add arbitrarily many child controls to it, and it will
automatically handle laying them out to fit as necessary.

Pete
Jun 27 '08 #2
Joe,

Have a look at the Anchor and Dock properties.

Trying to do it by hand will fail almost forever.
That was going when all screens had a standard rectangle.

Cor

"Joe Cool" <jo*****@home.netschreef in bericht
news:ar********************************@4ax.com...
>I am trying to display several images on a standard Windows Form. Each
image is displayed in a PictureBox control that is 180,130 in size. I
get the Primary Screen size to determine how many images will on one
line of images. I have a form boolean variable that I set to true in
the ClientSizedChanged event handler. In the loop where I am
displaying the images, I check this boolean, and if true, I set the Y
coordinate loop counter to the actual Y location of the last image
placed.

This seems to work OK for the first line of images drawn after the
first client size changed event, but it goes haywirea after that,
drawing each image at some random location on a line, with several
lines since the last image drawn.

It seems unpredictable on just how the client size is adjusted on an
autoscroll generated event.

Any help would be appreciated.
Jun 27 '08 #3

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

Similar topics

1
by: Harvey | last post by:
Hello: I am trying to use Autosize=true on a long string and it extends off of my form, rather than increasing the number of lines of the Label as the documentation says it should do. Would...
1
by: Weber Samuel | last post by:
Hi NG i try to catch the Application.Idle Event: --> Application.Idle += new EventHandler(OnIdle); Here's my problem: If i put a Label on my Form and set the Property AutoSize = true then...
9
by: Kevin Westhead | last post by:
Can anyone confirm whether or not there are any limits imposed on the widths of autosized columns in a list-view. I've found that the autosizing appears to have an upper limit, i.e. it will not...
0
by: OpticTygre | last post by:
How can you autosize a dynamically generated textbox on a form in VS2005 since there is no longer a TextBox.Autosize property? Everything I've read says that it should autosize automatically, but...
1
by: matthewtech | last post by:
In Visual Studio 2005, using Visual Basic, Is there a way to set the autosize property to false as a standard, and change it to true as needed? Or does it always start out as true when a label ...
8
by: Jordi Rico | last post by:
Hi, I've made the next inherited class in Visual Studio 2005: Public Class LabelEx Inherits System.Windows.Forms.Label Sub New() MyBase.New() Me.ForeColor = Color.Black Me.AutoSize = False...
2
by: =?Utf-8?B?Qm9i?= | last post by:
In VB.Net 2003 and previous versions new labels were created with AutoSize=False. In VB.Net 2005, new labels are created with AutoSize=True. Why was it changed? Is there somewhere in VB.Net 2005...
1
by: Nathan Laff | last post by:
I have a panel that I want to AutoSize with an AutoSize mode of GrowAndShrink, but I only want it to autosize vertically. Reason being I have anchors set up to a usercontrol which can resize. ...
0
by: Nathan Laff | last post by:
I have a panel set to autosize. Inside it I have a custom label, which changes the height (using measure string) based on the length of the string. (i.e. the label autosizes vertically) this label...
5
by: BillE | last post by:
I am using VB.NET, VS 2005 Add a windows form and in design view: Add a Radiobutton to the windows form Set AutoSize = True for the radiobutton Set the MaximumSize width to 90 for the...
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...
0
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...
1
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...
0
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...
0
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,...
0
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...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.