By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 1,680 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

formating strings into 2 columns

P: n/a
I draw the following string in a picturebox

LocaleInfo = Msg.PadRight(50, "."c) & buf

It's as close as I can get to having two columns.

Because all characters are not the same width what I get is a ragged second
column

Is there a simple way to get two columns.

I could measure Msg and work from there but I'd hate to do that and then
find out DotNet could do it for me.

Thanks

Cal
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* " active" <ac****@REMOVEa-znet.com> scripsit:
I draw the following string in a picturebox

LocaleInfo = Msg.PadRight(50, "."c) & buf

It's as close as I can get to having two columns.

Because all characters are not the same width what I get is a ragged second
column

Is there a simple way to get two columns.

I could measure Msg and work from there but I'd hate to do that and then
find out DotNet could do it for me.


There is no clearn way to do that. You will have to draw the different
parts of the string one after the other to get exact positioning.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
thanks
cal
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
* " active" <ac****@REMOVEa-znet.com> scripsit:
I draw the following string in a picturebox

LocaleInfo = Msg.PadRight(50, "."c) & buf

It's as close as I can get to having two columns.

Because all characters are not the same width what I get is a ragged second column

Is there a simple way to get two columns.

I could measure Msg and work from there but I'd hate to do that and then
find out DotNet could do it for me.


There is no clearn way to do that. You will have to draw the different
parts of the string one after the other to get exact positioning.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

P: n/a
"a" & vbTab & "b" & vbTab & vbTab & "c" & vbTab & "d" & vbCrLf & "a" & vbTab
& "b" & vbTab & vbTab & "c" & vbTab & "d" & vbCrLf

I drew the above in a picturebox and the tabs behaved as one would like.

That is I got columns and the space between the b and the c was twice the
space in the other two columns.

Seems to me that the picturebox handles CRLF's and TAB's.

Anyone (HerFried?) know how to set tab positions in a picturebox??

Cal

PS

Picturebox has a ResetText method but no Text property. I guess it gets one
from Control. Anyone know if Text is used for anything (The ResetText
implies it is)

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
* " active" <ac****@REMOVEa-znet.com> scripsit:
I draw the following string in a picturebox

LocaleInfo = Msg.PadRight(50, "."c) & buf

It's as close as I can get to having two columns.

Because all characters are not the same width what I get is a ragged second column

Is there a simple way to get two columns.

I could measure Msg and work from there but I'd hate to do that and then
find out DotNet could do it for me.


There is no clearn way to do that. You will have to draw the different
parts of the string one after the other to get exact positioning.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.