Formating Text in a text box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amruta

    #1

    Formating Text in a text box

    I have the following statements
    TextBox19.Text &= "ID" & ControlChars.Ta b
    TextBox19.Text &= "Requiremen t Name" & ControlChars.Ta b
    TextBox19.Text &= "Status" & ControlChars.Ta b
    TextBox19.Text &= "Owner" & ControlChars.Ne wLine

    I want to Bold and Underline only the above text and not the information
    that will be printed later below it.

    Also when the columns get filled they dont align correctly how can I do that.

    It currently looks like this
    ID Requirement Name Status Owner
    1 abcdef Draft John
    2 uryeuyreuyrueyr ueyruery Draft Amy
    3 ytreytryetryetr ye Accepted Carl

    It want it to looks like this
    ID Requirement Name Status Owner
    only the above line should be BOLD
    1 abcdef Draft John
    2 uryeuyreuyrueyr ueyruery Draft Amy
    3 ytreytryetryetr ye Accepted Carl


    Please can anyone tell me how to do the formatting within a text box

    Thank you

    Amruta
  • Jos Roijakkers

    #2
    Re: Formating Text in a text box

    You could consider using a richtextbox instead. That would give you a chance
    to underline and bold the column headers. But you will probably end up with
    e 'messy' column lign out, especially if the text values have different lengths.
    Therefor I would suggest you use a datagridview: it offers al the features
    you like (column alignment, bold, underline, etc).

    [color=blue]
    > I have the following statements
    > TextBox19.Text &= "ID" & ControlChars.Ta b
    > TextBox19.Text &= "Requiremen t Name" & ControlChars.Ta b
    > TextBox19.Text &= "Status" & ControlChars.Ta b
    > TextBox19.Text &= "Owner" & ControlChars.Ne wLine
    > I want to Bold and Underline only the above text and not the
    > information that will be printed later below it.
    >
    > Also when the columns get filled they dont align correctly how can I
    > do that.
    >
    > It currently looks like this
    > ID Requirement Name Status Owner
    > 1 abcdef Draft John
    > 2 uryeuyreuyrueyr ueyruery Draft Amy
    > 3 ytreytryetryetr ye Accepted Carl
    > It want it to looks like this
    > ID Requirement Name Status Owner
    > only the above line should be BOLD
    > 1 abcdef Draft
    > John
    > 2 uryeuyreuyrueyr ueyruery Draft Amy
    > 3 ytreytryetryetr ye Accepted Carl
    > Please can anyone tell me how to do the formatting within a text box
    >
    > Thank you
    >
    > Amruta
    >[/color]


    Comment

    • Mythran

      #3
      Re: Formating Text in a text box


      "Jos Roijakkers" <j.roijakkers@q red-it.nl> wrote in message
      news:5d4a1f3da9 468c8440bd34b6f 60@news.microso ft.com...[color=blue]
      > You could consider using a richtextbox instead. That would give you a
      > chance to underline and bold the column headers. But you will probably end
      > up with e 'messy' column lign out, especially if the text values have
      > different lengths.
      > Therefor I would suggest you use a datagridview: it offers al the features
      > you like (column alignment, bold, underline, etc).
      >
      >[/color]
      In my opinion, the ListView would work just fine for this. Instead of
      bolding, you would get actual columns and a column header, but without the
      need to have a "List" to bind with. It still works similar to the
      DataGridView too :)

      HTH,
      Mythran

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Formating Text in a text box

        "Jos Roijakkers" <j.roijakkers@q red-it.nl> schrieb:[color=blue]
        > You could consider using a richtextbox instead. That would give you a
        > chance to underline and bold the column headers. But you will probably end
        > up with e 'messy' column lign out, especially if the text values have
        > different lengths.[/color]

        I agree, but note that the 'SelectionTabs' property of the richtextbox can
        be used to set the tabstops' positions.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://classicvb.org/petition/>

        Comment

        Working...