I have been using Visual Basic for about two years now and I would rate my skills at below average but good enough to do what i want.
In the programs I make, I have a tendency to e.g. have multiple buttons that do mostly the same thing but with a difference of
"when button1 is clicked then label1.text = 1" and "when button2 is clicked then label2.text = 2".
But I was wondering if there's a way to simplify this in a way of just having "when buttonX is clicked then labelX.text = X" and switching the X with the value thats needed in code?
It might sound silly but i have no idea how i would do this and I also dont know how to formulate this idea so i can search it up on the web.
In the programs I make, I have a tendency to e.g. have multiple buttons that do mostly the same thing but with a difference of
"when button1 is clicked then label1.text = 1" and "when button2 is clicked then label2.text = 2".
But I was wondering if there's a way to simplify this in a way of just having "when buttonX is clicked then labelX.text = X" and switching the X with the value thats needed in code?
It might sound silly but i have no idea how i would do this and I also dont know how to formulate this idea so i can search it up on the web.