|
-
Mar 8th, 2010, 02:54 PM
#1
Thread Starter
Junior Member
Re: Any way to make these shorter?
Thanks Spoo! i made my array copying and pasting C1 (commandbuttons)
I renamed the Captions CH01, CH02 etc..
Code:
Private Sub C1_Click(index As Integer)
Label1.Caption = C1(index).Caption
End Sub
Now when i click on the buttons, the CH01 and CH02 show up as my Label1.Caption. Is there any way to remove the CH part of it?
Thanks for everyones patience, i am re-creating my app slowly.
-
Mar 8th, 2010, 03:07 PM
#2
Re: Any way to make these shorter?
 Originally Posted by bthology
Now when i click on the buttons, the CH01 and CH02 show up as my Label1.Caption. Is there any way to remove the CH part of it?
Code:
Private Sub C1_Click(index As Integer)
Label1.Caption = index
End Sub
You may have on off-by-one error, in which case you would use index + 1 instead.
Alternatively, if you want to separate your computer numbers from the computer labels (ie. Computer #107 occupies the 93rd slot, for example), you would use this:
Code:
Private Sub C1_Click(index As Integer)
Label1.Caption = Right$(C1(index).Caption,Len(C1(index).Caption-2)
End Sub
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
|