Solved

Treeview text formating

Posted on 2004-04-09
4
212 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 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

21 Experts available now in Live!

Get 1:1 Help Now