Formatting text in a text box control

Posted on 2009-04-22
Last Modified: 2012-05-06
I have about 3 paragraphs of text (its a disclaimer) to show, but I want to show maybe 3 lines and let them scroll through the rest.  The problem is when I put everything in a text box the formatting is messed up, mostly spacing and new lines where there is still room on the previous line.  What is the best way to handle this.  Is the textbox control the correct control.  This is a web page (aspx) we are talking about

Question by:mgmhicks
    LVL 39

    Expert Comment

    It sounds to me that the lines you want to show are already broken up with newlines in-between. Remove those newlines, except for the double newlines that separate the paragraphs. This will make the textbox do normal breaking of the lines.

    Yes, it is common practice to use a multiline textbox for this on a web page.

    If I misunderstood your question, can you please show two screenshots: one of what you have now and one of what you want it to look like (use Word or something like that).

    Author Comment

    Here is the screen shot.  This text is in a note pad.  Looks good in there.  I copy and paste to textbox and you see what the textbox is beginning to look like.  I would just like about a 4 line textbox that scrolls with this verbage justified.
    LVL 39

    Accepted Solution

    Aha. Then it is like I said. Remove the line ends (except from the paragraphs). It will show in Visual Studio as three very long lines. The result will be that you have neatly formatted lines in your textbox in both the browser and the preview window.

    Use CSS to format the textbox higher: height: 30px; (or you can use Height property of Textbox control).


    Author Closing Comment

    Thank you
    LVL 39

    Expert Comment

    you're welcome :)

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    This video discusses moving either the default database or any database to a new volume.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now