470,626 Members | 2,153 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,626 developers. It's quick & easy.

String.Format used to make columns

ControlRichTextBox1.SelectedText = String.Format("{0} {1}", strExt,
x.szTypeName) & vbCrLf

Three questions:

1) How can I insert a tab between {0} and (1} so the richtextbox tabs
x.szTypeName into a nice column?

2) How can I insert spaces so as to line up x.szTypeName into a nice column?

3) Is there a better way?

Thanks
Nov 21 '05 #1
8 10188

" **Developer**" <RE*************@a-znet.com> wrote in message
news:Oh**************@TK2MSFTNGP12.phx.gbl...
ControlRichTextBox1.SelectedText = String.Format("{0} {1}", strExt,
x.szTypeName) & vbCrLf

Three questions:

1) How can I insert a tab between {0} and (1} so the richtextbox tabs
x.szTypeName into a nice column?

2) How can I insert spaces so as to line up x.szTypeName into a nice
column?

3) Is there a better way?

Thanks


Dim s As String = String.Format("{0,-20} {1}", param1, param2)

That will give you spaces...

Mythran

Nov 21 '05 #2

| 1) How can I insert a tab between {0} and (1} so the richtextbox tabs
| x.szTypeName into a nice column?

help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemDrawingStringFormatClassSetTabStopsTopi c.htm

| 2) How can I insert spaces so as to line up x.szTypeName into a nice
column?

this is a less-than-useful way to go as non-fixed-width fonts line up
differently.

| 3) Is there a better way?

see reference to question 1.
Nov 21 '05 #3
Better than what I had but the column is ragged. Probably need to use tabs
to get it perfect.

Thanks

"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...

" **Developer**" <RE*************@a-znet.com> wrote in message
news:Oh**************@TK2MSFTNGP12.phx.gbl...
ControlRichTextBox1.SelectedText = String.Format("{0} {1}", strExt,
x.szTypeName) & vbCrLf

Three questions:

1) How can I insert a tab between {0} and (1} so the richtextbox tabs
x.szTypeName into a nice column?

2) How can I insert spaces so as to line up x.szTypeName into a nice
column?

3) Is there a better way?

Thanks


Dim s As String = String.Format("{0,-20} {1}", param1, param2)

That will give you spaces...

Mythran

Nov 21 '05 #4

" **Developer**" <RE*************@a-znet.com> wrote in message
news:e1**************@TK2MSFTNGP14.phx.gbl...
Better than what I had but the column is ragged. Probably need to use tabs
to get it perfect.

Thanks

As <unprintablecharacter> stated, the columns won't line up if you are not
using a fixed-width font. Tabs may not work either (example as follows):

1234 HERE
123456789 HERE

Mythran

Nov 21 '05 #5
Thanks
"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:eC**************@TK2MSFTNGP15.phx.gbl...

" **Developer**" <RE*************@a-znet.com> wrote in message
news:e1**************@TK2MSFTNGP14.phx.gbl...
Better than what I had but the column is ragged. Probably need to use
tabs to get it perfect.

Thanks

As <unprintablecharacter> stated, the columns won't line up if you are not
using a fixed-width font. Tabs may not work either (example as follows):

1234 HERE
123456789 HERE

Mythran

Nov 21 '05 #6
>
help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemDrawingStringFormatClassSetTabStopsTopi c.htm

How do I use this?

I tried pasting it into IE (got page can not be displayed)

and also into VS Help without finding it.

I did use Google and found it but I expect there is a better way.
Thanks
Nov 21 '05 #7

sorry...open the vs.net ide, then click the help menu and select
search...from there, search on settabstops.

that should get you there.
Nov 21 '05 #8
Thanks a lot.

I had found it in help but you gave what I think is a URL that should have
found it for me and I wondered why it didn't work for me.

thanks again
"" <a@b.com> wrote in message news:7h*******************@fe04.lga...
sorry...open the vs.net ide, then click the help menu and select
search...from there, search on settabstops.

that should get you there.

Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Neil Schemenauer | last post: by
32 posts views Thread by tshad | last post: by
1 post views Thread by J.B | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.