Treeview text formating

Posted on 2004-04-09
Medium Priority
Last Modified: 2012-06-27
I have a Treeview activeX object display some of my data. One branch needs to be formated so it looks like it is in 2 columns. I just cant get my pad function to work correctly. This is what I have:

Public Function PadRight(strIn As String, intLength As Integer)
    If Len(strIn) < intLength Then
        PadRight = strIn & String(intLength - Len(strIn), " ")
        PadRight = Left(strIn, intLength)
    End If
End Function

And this is how I call it...

   strTXT = rsOverview!Brand & " - " & rsOverview!Model
   mNode.Text = PadRight(strTXT, 40) & "Total: " & rsOverview!Total & "   Available:" & rsOverview!Available

Nothing lines up in the second column at all unless the strTXT is the same length as the others.
Any Ideas?
Question by:noodleNT
  • 2
  • 2
LVL 39

Accepted Solution

stevbe earned 500 total points
ID: 10793392
Are you using a "fixed" font like Courier New? If not, adding spaces is likely not going to line up exactly.


Author Comment

ID: 10793773
Ahh... How do I set the font?

Author Comment

ID: 10793857
HEHE... I cant beleive I asked that question.
Sometimes I wish there was a delete on this thing.
LVL 39

Expert Comment

ID: 10805363
lol ... glad it is working for you ... If you have seen some of my answers you would know I sometimes frantically search for the "delete" myself. I bet you could get community support to delete it if you rwally wanted to.


Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
A Case Study of using the Windows API to provide RS232 communications capability in Access without the use of Active-X controls.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

587 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