How to randomize the alphabet

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<pre class="prettyprint lang-vb Randomize()
Dim Alpha() As Char
Alpha = New Char() {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}

Dim Box() As TextBox = {t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26}
For i As Integer = 1 To Box.GetUpperBound(0) + 1
i = Int((Rnd(i) * 26) + 1)
Box(i - 1).Text = Mid(Alpha, i, 1)
Next i[/code]
So i have this code and what i am trying to achieve is random letters to go into 26 txtboxes hence the Box() array. I am having trouble can someone please help. Thanks.

View the full article
 

Similar threads

Back
Top