|
-
Jul 4th, 2001, 06:52 AM
#1
Thread Starter
Addicted Member
listbox allignment
I've got a listbox which show a series of integers. Is it possible to set the allignment of a listbox to right?
"Computers are incredibly fast, accurate and stupid. Human beings are incredibly slow, inaccurate and brilliant. Together they are powerful beyond imagination." - Albert Einstein
-
Jul 4th, 2001, 08:23 AM
#2
Well ...
You can pad the numbers and artificially right-align them.
Code:
Dim I As Integer
For I = 0 To 100 Step 1
List1.AddItem Space(5 - Len(CStr(I))) & CStr(I)
Next
.
-
Jul 4th, 2001, 09:31 AM
#3
Thread Starter
Addicted Member
Thanx, that works just fine for me.
I just wrote a piece of code before this piece to determine the largest number on my list, so I could take that into account.
Rick
"Computers are incredibly fast, accurate and stupid. Human beings are incredibly slow, inaccurate and brilliant. Together they are powerful beyond imagination." - Albert Einstein
-
Jul 5th, 2001, 04:18 AM
#4
Well ...
If you don't want to go through your numbers calculating the length of the largest number, you can set up the number (5 which I have used) to something which will cover up for the maximum length in the selected data type. For e.g. if you are using integers, the maximum length could be 5 digits or 6 if you include the sign. So you can use 6 or 7 instead of 5 which I have used.
.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|