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

Resize before Load?

Greetings!

I have a form with a listview, a menu, and a few text boxes, labels and
command buttons. I want to resize the listview when the form is resized to
that the widths of the spaces between the borders of the listview and the
borders of the form remain constant. I am finding this to be unexpectedly
hard. For one thing, I initialized some values in the form's Load event,
and I'm doing the control resizing in the form's Resize event. But I am
finding that the Resize event fires first! Actually, the Resize event fires
four times before the form's Load event! How can this be?

Thanks!

Rob, who obviously has some fundamental flaws in his understanding of event
sequences.
Nov 20 '05 #1
4 3444
In article <ur**************@tk2msftngp13.phx.gbl>, th*****@n2net.net
says...
I have a form with a listview, a menu, and a few text boxes, labels and
command buttons. I want to resize the listview when the form is resized to
that the widths of the spaces between the borders of the listview and the
borders of the form remain constant. I am finding this to be unexpectedly
hard.


Instead of doing it with events, look into the Anchor and Dock
properties of your form.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #2
Patrick,

Thanks for the tip. I will look into those properties.

But could you please explain why I'm getting resizes before loads? I'm
afraid that if I don't understand that, I'm going to get bitten in
uncomfortable locations on repeated occasions.

Thanks!

Rob
Nov 20 '05 #3
Hi Rob,

You can open the design part of the code in a form by pushing on the + in
the code.
There you will see a lot of coding accoording *me.* that is the form, there
are as well settings that affects the size setting itself however as well
thinks as border which can be different, have a look at that, I hope you
will understand it than more?

When not, feel free to reply?

Cor
Nov 20 '05 #4
VJ
The resize event does fire before load, that is windows sequence of events,
its given. It fires 4 times.. that is interesting.. maybe your resize code
is causing it to do that..

if you want not to fire the resize, set a boolean variable make it false in
the form constructor, then set it to true after the Load event's last line
of code. Use this boolean to drive your code in resize.

Private Sub New()
{
blnVariable = false
Intialziecomponent()
..
}

Private sub Form1_Load(...)..
{
'Code starts here...

'Last Line of Code..
blnVariable = true
}

Private Sub Form1_Resize (... )..
{
if blnVariable then
'execute resize code.. here..
end if
}

VJ

"Rob Richardson" <th*****@n2net.net> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Greetings!

I have a form with a listview, a menu, and a few text boxes, labels and
command buttons. I want to resize the listview when the form is resized to that the widths of the spaces between the borders of the listview and the
borders of the form remain constant. I am finding this to be unexpectedly
hard. For one thing, I initialized some values in the form's Load event,
and I'm doing the control resizing in the form's Resize event. But I am
finding that the Resize event fires first! Actually, the Resize event fires four times before the form's Load event! How can this be?

Thanks!

Rob, who obviously has some fundamental flaws in his understanding of event sequences.

Nov 20 '05 #5

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

Similar topics

4
by: Julia Briggs | last post by:
I am struggling to create a PHP function that would take a specified image (JPG, GIF or PNG) from a link, and resize it down to a thumbnail so it will always fit in a 200x250 space. I am hoping...
6
by: | last post by:
Hello all, This is an IE6 question: When I click on an image file on my desktop, ie will automatically resize the image to fit the window. But, when I use html to load the image, i.e. <img...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
2
by: J'son | last post by:
Guys, I have built an application for a client that allows people to list their products for sale along with a photo of the product. If the photo is too big, I currently resize it down when the...
1
by: garyusenet | last post by:
I'm following a sql/vb tutorial which contains the following code which is meant to resize the datagrid view so that the columns take the correct width for the content within them. It doesn't...
3
by: Jim Langston | last post by:
I really am not sure if this question belongs in this newsgroup, but not sure where else to ask it. There is someone working on a game that I tested, and it was taking >30 seconds to load. He...
11
by: eholz1 | last post by:
Hello PHP group, I am using some php code to check the size of images, and then resize or determine new dimension for the image. GD seems quite slow. It takes about 5 seconds (plus or minus) to...
2
by: Smitty | last post by:
Did a search & found nothing on this. VB6 did a resize on form load according to what I've read. I Resized screen under vista & now the text box doesn't resize to form's clientarea. Code exists...
8
by: infoseekar | last post by:
Image Resize & Rotation Hi I have 2 scripts, one for Image rotation and other image resize and they both are working. Image resize scripts load the picture and resize it and Image rotation...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.