Solved

Treeview text formating

Posted on 2004-04-09
4
240 Views
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), " ")
    Else
        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?
0
Comment
Question by:noodleNT
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
stevbe earned 125 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.

Steve
0
 

Author Comment

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

Author Comment

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

Expert Comment

by:stevbe
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.

Steve
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

820 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