Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21744

[RESOLVED] What's the alternative for this Code in VB 2010?

$
0
0
This program is a program in which the user inputs a number into a Text Box and clicks a Button resulting in that number to appear in stars (*) in a List Box, for example.....
User Inputs 5......List Box will display this
*
**
***
****
*****

My Question is, Im using VB 2010 and " List1.AddItem String$(J,"*") " is not the correct syntax, so what is? Can anybody help me? Thanks! :wave:

Dim I As Integer
Dim J As Integer

If IsNumeric(Text1.Text) Then
I = CInt(Text1.Text)
End If

For J= 1 To I
List1.AddItem String$(J,"*")
Next J

Viewing all articles
Browse latest Browse all 21744

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>