Solved

Right justify text field, vb.net

Posted on 2007-03-27
2
911 Views
Last Modified: 2013-11-26
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,
0
Comment
Question by:Baikie
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 50 total points
ID: 18804262
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():
http://msdn2.microsoft.com/en-us/library/system.string.padleft.aspx
http://msdn2.microsoft.com/en-us/library/system.string.padright.aspx
0
 

Author Comment

by:Baikie
ID: 18806283
Hi,

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

Ta.

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

See ya
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question