Hello, I have 23 buttons on my form. 3 of them are for navigation. Then the rest basically will get information put in them from a db... So lets say for example the color spectrum (well 20 colors anyways) are displayed in the form.. one for each button.
How can I say if any of the first 20 buttons are pressed, call AddtoSearchResults(text_of_button_pressed)
right now I am doing it like this :/
How can I say if any of the first 20 buttons are pressed, call AddtoSearchResults(text_of_button_pressed)
right now I am doing it like this :/
Visual Basic:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(Button1.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(Button2.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button3.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button4.Text)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button5.Text)
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button6.Text)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button7.Text)
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button8.Text)
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button9.Text)
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button10.Text)
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button11.Text)
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button12.Text)
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button13.Text)
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button14.Text)
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button15.Text)
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button16.Text)
End Sub
Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button17.Text)
End Sub
Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button18.Text)
End Sub
Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button19.Text)
End Sub
Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call AddtoSearchResults(button20.Text)
End Sub
Last edited by a moderator: