Ok, I have a form with about 750 buttons and i want to be able to refer to a button based on a string.
For example, instead of writing...
Button1_A.BackC olor = Color.ForestGre en
I want to write...
Dim Q_No As String
Dim Btn_Type As String
Dim Btn As String
Private Sub Another_Button_ Click(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles Another_Button. Click
Q_No = "1"
Btn_Type = "A"
Btn = "Button" & Q_No & "_" & Btn_Type
Btn.BackColor = Color.ForestGre en()
End Sub
But i just get the error message "'BackColor ' is not a member of 'String'"
For example, instead of writing...
Button1_A.BackC olor = Color.ForestGre en
I want to write...
Dim Q_No As String
Dim Btn_Type As String
Dim Btn As String
Private Sub Another_Button_ Click(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles Another_Button. Click
Q_No = "1"
Btn_Type = "A"
Btn = "Button" & Q_No & "_" & Btn_Type
Btn.BackColor = Color.ForestGre en()
End Sub
But i just get the error message "'BackColor ' is not a member of 'String'"
Comment