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 8920617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:19:03+00:00 2026-06-15T06:19:03+00:00

Hey all i am currently looking for a way to calculate the width &

  • 0

Hey all i am currently looking for a way to calculate the width & left position of MAX 12 txtboxes on my report form. The height will always be 0.206 as well as top will always be 0.

This is what the code looks like with 12 (max) txtboxes:

txtData1.Width = 0.7
txtData1.Left = 0

txtData2.Width = 0.7
txtData2.Left = 0.708

txtData3.Width = 0.7
txtData3.Left = 1.416

txtData4.Width = 0.7
txtData4.Left = 2.124

txtData5.Width = 0.7
txtData5.Left = 2.832

txtData6.Width = 0.7
txtData6.Left = 3.54

txtData7.Width = 0.7
txtData7.Left = 4.248

txtData8.Width = 0.7
txtData8.Left = 4.956

txtData9.Width = 0.7
txtData9.Left = 5.664

txtData10.Width = 0.7
txtData10.Left = 6.372

txtData11.Width = 0.7
txtData11.Left = 7.08

txtData12.Width = 0.7
txtData12.Left = 7.788

According to my calculations (which i love math…math just doesn’t love me :o)) the total width would be 8.4 in and the total left would be 7.788 in. The sheet is 8.5 in wide (landscape view).

layout

So now the hard part comes into play. For 11 boxes, the width would go up a little and the left position would also go up to accommodation the extra space not having the 12th box anymore.

I am trying to find a nice way of doing this with minimal code since i know i can do the same as above for each level (12 to 2 textboxes) but that would be a lot of code.

So any help with calculating the remaining 11-2 txtboxes would be a big help! :o)

  • 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-06-15T06:19:04+00:00Added an answer on June 15, 2026 at 6:19 am

    I’m not sure I completely understand your question, but what I am gathering is that you always want the textboxes to completely fill up the 8.5 inches.

    If that is the case, I would do something as follows:

        Dim NumberOfBoxes As Integer = 11 ' Number of textboxes you'll have next to each other
        Dim AssignedWidthPerBox As Double = 8.5 / NumberOfBoxes
        Dim CurrentLeft As Double = 0   ' How Far left you are on your form - Increment this by AssignedWidthPerBox for each textbox
    

    Then you assign the Textbox properties eaither through a loop (preferred) or by hand as follows:

        txtData1.Width = AssignedWidthPerBox
        txtData1.Left = CurrentLeft
        CurrentLeft += AssignedWidthPerBox
    

    Hope this helps

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

Sidebar

Related Questions

Hey all, I'm currently working on a Java Swing application and I was looking
Hey all, I have an HTML form on my website which currently only uses
Hey all, I am looking for a way to query my database table only
Hey All, I currently use Google's API to include jQuery into my sites like
Hey all, here is the issue I am currently trying to work through. We
Hey all I'm extremely new to jquery and ajax and I'm looking for some
Hey all. Is there a way to copy only a portion of a single
Hey all, I'm currently teaching myself Objective C and I'm kind of stuck. I'm
Hey all.. exactly as it sounds. currently using @fontface, lettering.js, and kern.js to get
Solved Hey all, I'm currently working on a Split-View Based Application for iPad. I

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.