Hi,
I am taking a beginning VB.Net class and I have a project where I need to check the text of 16 buttons. I can easily do this with If Then statements but I am curious if I could do this by running a For Next loop. Here is the code I have tried:
Unfortunately, I get the following error: 'Button' is a type and cannot be used as an expression.
Can anyone please help a noob and guide me in the right direction? Thanks!
I am taking a beginning VB.Net class and I have a project where I need to check the text of 16 buttons. I can easily do this with If Then statements but I am curious if I could do this by running a For Next loop. Here is the code I have tried:
Code:
Dim btn As Integer Dim x As String For btn = 1 To 16 x = btn If Button(x).text = "" Then MsgBox("Everything appears correct except you still have blanks in the puzzle.") End If Next btn
Can anyone please help a noob and guide me in the right direction? Thanks!
Comment