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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:05:35+00:00 2026-05-22T13:05:35+00:00

I was reviewing some of my old code and I have a method that

  • 0

I was reviewing some of my old code and I have a method that statically resizes the height of a textbox control at runtime based on the clients screen width. So there were hardocded values if screen resolution is say “1280×800” then the texbox’s height is going to be 475px. OK I get it… BAD It was semi-OK a few years ago with the fewer number of screen resolutions and CRT monitors, but not now for a number of reasons.

I have gotten much better with JavaScript and a bit better with jQuery and am looking for a solution that can resize the height of the textbox containing some text from the database based on the overall width of the containing DIV which is sized to 100% of the client’s screen width. That means wider screens need a smaller height, and less wide screens need a larger height.

I want to do this dynamically if possible. My last resort is to fix the containing control’s width which should dicate a fixed height, but I would rather the text control span the full 100% of the page.

Any suggestions are appreciated. Thanks!

  • 1 1 Answer
  • 2 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-22T13:05:35+00:00Added an answer on May 22, 2026 at 1:05 pm

    That sounds like the equivalent of retrieving the text metrics before you render it to the display. I can think of ways that is done in Win Forms but in the browser… I could only think of presenting the text in an equivalently sized div (taking into account the padding in the textbox) and grabbing the rendered size, removing the div (you could do this somewhat invisibly as the page loaded) and applying the results to your textbox.

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

Sidebar

Related Questions

I have been reviewing some code that looks like this: class A; // defined
I'm just reviewing some of my old code (have some spare time), and I
I was just reviewing some old code and found the following (inside foo.asp): Const
I'm reviewing some code for a friend and say that he was using a
I'm reviewing Java code that essentially is a recurring process that moves/reads/parses some files
I'm reviewing some code in VB.net, and in a validation object they have written
Here's the situation. I'm reviewing some SDK code that I didn't write because I've
I'm reviewing some legacy code and I've found a bug that causes the response
I was reviewing some of my old code and came across this syntax: extractDir=${downloadFileName%.*}-tmp
Reviewing some code that contains a bunch indirectly nested transactionscopes. I would like to

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.