resize forms in vb6.0

Hi there,

I need an understanding on how to resize forms in vb6.0. I understand the min and max atributes but i need to know how to go about having my content in the forms stretch or resize to fit the size window instead of having a large window but all my content being the same size in the top left hand corner.

Im looking for the coding logic for going about doing this.

Thanks in advanced.
irfoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vinnyd79Commented:
Check out the code in this example. It should give you an idea on how to resize the controls and objects.

http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B182070
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cool12399Commented:
Basically there is no easy way to do this in VB6.
But essentially this is what happens.

Any time a form is resized (i.e., your application), the "form_resize" event is called.
To get the 'new' dimensions of your form, you would have form1.width and form1.height.

Based on that new information, you simply figure out how the controls within your form
should be resized. For example, say you had a text box that you wanted to be the size
of the form. Then you would have

private sub form_resize()

formWidth = form1.width
formHeight = form1.height

myTextBox.width = formWidth
myTextBox.height = formHeight

end sub

Of course, if you had other controls (i.e., other text boxes), you would decide how they should
be resized in relation to each other. I.e., is text box #2 always to the right of textbox #1? If
so, then you would say textBox2.left = textBox1.width + textBox1.left (so textBox2 takes into
account textBox1's starting location (the 'left' part), and then plus its width).

You basically have to play around with it to get it the way you like it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.