473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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 10475

" **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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Neil Schemenauer | last post by:
The title is perhaps a little too grandiose but it's the best I could think of. The change is really not large. Personally, I would be happy enough if only %s was changed and the built-in was...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
1
by: J.B | last post by:
I have a datagrid that will display different datasets, (it runs different sprocs based on a value in the querystring) but it will always return 6 columns. The 5th and 6th columns are always Date...
9
by: Coleen | last post by:
Hi All :-) I found the way to get my column sum (Thanks Cor I did it a little different, but the result is what I wanted) I used: dt_stat_report_3b.Columns.Add(New DataColumn("Sum",...
20
by: MLH | last post by:
120 MyString = "How many copies of each letter do you need?" 150 MyVariant = InputBox(MyString, "How Many?", "3") If MyVariant = "2" Then MsgBox "MyVariant equals the string '2'" If...
8
by: Ian Davies | last post by:
Hello I have the following sql string to run as a command in my VB6 project to update mysql table strSQL = "LOAD DATA INFILE " & ImportFile & " INTO TABLE tPupils FIELDS TERMINATED BY ','...
2
by: Brian Parker | last post by:
I am beginning to work with VB2005.NET and I'm getting some problems with string formatting converting an application from VB6. VB6 code:- sTradeDate = Format(pArray(4,i Record), "mmddyy") ...
1
by: Rob | last post by:
Hey folks, I should be ashamed for not knowing the answer to this question - but I don't get the opportunity to program all that much anymore... I have a data tracking program used by over 150...
3
by: 6afraidbecause789 | last post by:
If able, can someone please help make a Where clause that strings together IDs in a multi-select listbox AND includes a date range. I wasn’t thinking when I used the code below that strings...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.