VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way)

by Patrick Lockefeer (V) (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 8th July 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way)

API Declarations


Dim x As Long

Controls :
ListBox Name : List1
Command Name : Command1 Caption : Add to list

Rate Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way)



'See also Vbcodes of me on Snippets ; Page 607 & 609

'This code adds zero values with the alphabet letters (a to z) to a Listbox

Private Sub Command1_Click()
For i = 0 To 0   'returns Zero values
For x = 65 To 90 'returns characters a to z
List1.AddItem Chr(x) & (i)
Next x
Next i
End Sub

'Please experiment with this code (many variations are possible in a fast way)

'Changing code Possibilities :

'Note 1. How to change (prefix)numbers:

For i = 0 To 0   'returns "Zero" values
For i = 1 To 1   'returns "One" values
For i = 2 To 2   'returns "Two" values

'Note 2 . Use Copy and Paste to make(add)different positions : 

'Copy : Chr(x) or (i) and place an Ampersand (&) between them .

'example 1. change code line to: List1.AddItem Chr(x) & (i)& Chr(x)& Chr(x)
'example 2. change code line to : List1.AddItem (i)& Chr(x) & (i)& Chr(x)

Good Luck

Patrick

Download this snippet    Add to My Saved Code

Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way) Comments

No comments have been posted about Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way). Why not be the first to post a comment about Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way).

Post your comment

Subject:
Message:
0/1000 characters