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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:52:26+00:00 2026-05-11T09:52:26+00:00

I have a multi-line textbox that typically displays very long strings (license agreements, for

  • 0

I have a multi-line textbox that typically displays very long strings (license agreements, for example), and a requirement around the display is that if the user ‘pages’ through the text via the vertical scrollbar (not clicking the arrows or the scroll box, but clicking above or below the scrollbox), on the last ‘page’ the first line must be the last line from the previous page, and the text is padded with blanks lines to accommodate this.

I know I can get the size of the string, and the number of lines in the textbox, but is it possible to retrieve the number of lines displayed in the textbox at one time so I can calculate how much the text will need to be padded? Looking at the list of messages I can send via P/Invoke, I don’t see one to request the number of displayed lines.

  • 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. 2026-05-11T09:52:26+00:00Added an answer on May 11, 2026 at 9:52 am

    You could get the maximum number of lines displayed at one time by calculating the font height and devide the textbox height by that.

    Just an idea… Not sure if it will come out correct, but you could do some tests and see if it matches.

    To get the font Height:

    public SizeF MeasureString( string text, Font font )

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

Sidebar

Related Questions

I am trying to have a multi line textbox that when you type in
I have a multi-line textbox (let's call it textBox1) that has plenty of text
I have a multiline textbox that contains very long text in it. How can
Is it possible to have a multi-line textbox (im using asp.net c#) where the
I have a multi-line string that I want to do an operation on each
/* Suppose I have a multi-line comment with hard line-breaks * that are roughly
lets say I have a multi-line textbox with 100 lines, how would you go
I have a multiline textbox that by default, is set to ReadOnly. I would
I've got a multiline textBox that I would like to have a label on
I received some multi-line data via HTTP and have it in one string. 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.