Solved

Right justify text field, vb.net

Posted on 2007-03-27
2
910 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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.   …
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now