Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4032024
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:40:11+00:00 2026-05-20T11:40:11+00:00

I’m building an application in VB6 where the standard form size is 1024×768, for

  • 0

I’m building an application in VB6 where the standard form size is 1024×768, for the older monitors that will see it. Some of the users will, however, have higher resolutions available, and I’d like the program to still look nice when they maximize the screen. I don’t want to resize the elements on the form at all, but I am looking to recenter everything. There are two options as I see it, and I don’t really like either one:

  • The _real_ way, writing dynamic code that’ll place each element on the form in relation to other elements, so that no matter what size it is, they’ll always recenter properly.
  • The easier but cheesier way, to put all the elements in a 1024×768 PictureBox and just center that on the screen whenever the form is resized.

I don’t love the first one because ugh, and I don’t love the second one because it’s such an ad hoc solution. Also, while I like the idea behind the first one more, it has the problem of permanence: if I need to go back and change some elements, I’m then stuck rewriting lots of repositioning code. And the second one has a sorta similar issue, that I’d lose one of the nice things that VB6 does provide: being able to see the grid structure of the form.

Anyone know of any magic solutions?

I’m currently leaning towards the PictureBox, just because the prospect of writing and undoubtedly rewriting all that positioning code is depressing. The issue here then is that I already have these 50+ elements on the form, but I’d need them to be in the PictureBox. I can copy and paste without creating the array it always seems to want to make, but then I’d have to go through an rename them all… so my second question, is there any simple way to transfer a preexisting element on a form into a PictureBox?

Thanks everyone!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:40:12+00:00Added an answer on May 20, 2026 at 11:40 am

    There is no free lunch. If you want your VB6 application to “look nice” when resized, you have to write the dynamic sizing logic in the Form_Resize event. Otherwise, as others have stated, you’ll have large gray areas with everything crammed in the upper left corner. Centering in a PictureBox isn’t much better. Either way, it will look non-standard and amateurish.

    I’ve written this type of code for several VB6 applications. I’ll agree that it’s a little tiresome to write, but it’s not difficult. You just have to think about:

    • Button positioning – The lower right coordinates of your form will change, and buttons are usually placed along the right side, or relative to the lower-right corner.
    • Display control resizing – You can widen listboxes, multi-line textboxes, dropdown lists, etc. Your code can decide if these should be a percentage of the form’s new width/height, or should expand to fill what’s left after you’ve positioned everything else. I think the latter approach works better, but it depends on the application.
    • The margin between the controls and the edges of the form, as well as the margin between the controls themselves. I define a value named “Gutter” to hold this value, then apply it as necessary when positioning, say, a series of buttons horizontally relative to the lower right corner.
    • Don’t resize buttons or labels, just reposition them.
    • Don’t resize fonts.

    “Anchor” type properties make this type of code unnecessary in VB.NET. If you think about that for a minute, you’ll see that if a few properties can handle this logic, the lines of code needed to do the same can’t be all that complex. Once you have the first control positioned and sized, you can base other controls positions off that control’s top, left, width, and height, and just walk your way across the form.

    When you get it right, I think you will find that it actually is worth the effort.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.