-
bool clicked = false
-
-
SUB start //the one that handles button clicks
-
clicked = !clicked
-
if(clicked == true)
-
{
-
For i = 0 To AlphabetArray.GetUpperBound(0)
-
AlphabetArray.SetValue(letter, i)
-
Alphabet.Lettertxtbox.Clear()
-
Next i
-
}
-
-
SUB end
-
Hi.
I rewrote it this way:
In a module: Public clicked as Boolean
-
clicked=(Not clicked)
-
-
If clicked.Equals(clicked) Then
-
For i = 0 To AlphabetArray.GetUpperBound(0)
-
AlphabetArray.SetValue(letter, i)
-
Alphabet.Lettertxtbox.Clear()
-
Next i
-
End If
-
But it behaves the same way as before: AddNew button is active only if textbox.text is <> ""; click AddNew button; loop starts and value added via textbox is added to all array length (confirmed using MessageBox to get values of array).
The loop must work this way:
ArrayCreated[...],[...],[...],etc...
AddNew button inactive until textbox text is ""
AddNew button click
Loop starts and set value passed via textbox to array: Array[a],[...],[...], etc...
textbox text cleared
AddNew button inactive until textbox text is ""
loop waits
user types new value in textbox
AddNew button click
loop restarts: new value typed is added to Array[a],[b],[...],etc...
loop waits
user types new value in textbox
AddNew button click
loop restarts: new value typed is added to Array[a],[b],[c],etc...
this until i=Array.GetUpperBound(0)
when i = array.getupperound(0)
AddNew button and textbox inactive
Another button active to proceed
Hope it's clear.
Luca