473,386 Members | 1,598 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,386 software developers and data experts.

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 1097
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: 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: 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:
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
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...
0
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,...
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...
0
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,...

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.