Home All Groups Group Topic Archive Search About

Formating Text in a text box

Author
12 May 2006 4:39 PM
amruta
I have the following statements
TextBox19.Text &= "ID" & ControlChars.Tab
TextBox19.Text &= "Requirement Name" & ControlChars.Tab
TextBox19.Text &= "Status" & ControlChars.Tab
TextBox19.Text &= "Owner" & ControlChars.NewLine

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      uryeuyreuyrueyrueyruery           Draft      Amy
3      ytreytryetryetrye       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      uryeuyreuyrueyrueyruery    Draft                Amy
3      ytreytryetryetrye                 Accepted        Carl


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

Thank you

Amruta

Author
12 May 2006 4:48 PM
Jos Roijakkers
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).


Show quoteHide quote
> I have the following statements
> TextBox19.Text &= "ID" & ControlChars.Tab
> TextBox19.Text &= "Requirement Name" & ControlChars.Tab
> TextBox19.Text &= "Status" & ControlChars.Tab
> TextBox19.Text &= "Owner" & ControlChars.NewLine
> 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      uryeuyreuyrueyrueyruery           Draft      Amy
> 3      ytreytryetryetrye       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      uryeuyreuyrueyrueyruery    Draft                Amy
> 3      ytreytryetryetrye                 Accepted        Carl
> Please can anyone tell me how to do the formatting within a text box
>
> Thank you
>
> Amruta
>
Author
12 May 2006 5:33 PM
Mythran
"Jos Roijakkers" <j.roijakk***@qred-it.nl> wrote in message
news:5d4a1f3da9468c8440bd34b6f60@news.microsoft.com...
> 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).
>
>
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
Author
12 May 2006 10:12 PM
Herfried K. Wagner [MVP]
"Jos Roijakkers" <j.roijakk***@qred-it.nl> schrieb:
> 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.

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/>