Zdravim. Jak lze zjednodušit tenhle jednoduchy kod? Mám hodně událostí od tlačítek a v každé je k nim přiřazená stejná proměnná, kterou volám v proceduře. Díky.
Public Class Form1
Public Kod As Integer
Private Sub Command1_Click()
Me.TextBox1.Text = Kod
End Sub
Public Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Kod = 1
Command1_Click()
End Sub
Public Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Kod = 2
Command1_Click()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Kod = 3
Command1_Click()
End Sub
End Class