Solved

Treeview text formating

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

803 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