Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Treeview text formating

Posted on 2004-04-09
4
Medium Priority
?
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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