• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 934
  • Last Modified:

Right justify text field, vb.net

Hi There,

I have a small app that drills into a database and displays the results in a datagrid. The user can then edit the records then save the results to a .txt file which is then e-mailed to a recipient.

The text file is formatted a certain way with some fields padded out and some fields truncated. However i need to right justify a couple of fields but cannot see a way of doing this. I am using vb.net 2003.

Many Thanks,
1 Solution
Mike TomlinsonMiddle School Assistant TeacherCommented:
Without seeing your code that saves the data to a text file it is hard to make recommendations.

As a generalization, you probably want String.PadLeft() and String.PadRight():
BaikieAuthor Commented:

thanks for the reply. I was just being stupid. The pad left would have the same functionality as right justify!


Will give the points to you anyway for the reply!!

See ya
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now