Might be a really dumb question considering I’m new to this whole coding thing, but please bare with me. Here’s what I want to do:
I have 2 TextBox. TextBox1, TextBox2
I want this to happen:
When I press Button1, input “1” for the specific TextBox i previously clicked on/selected while operating the app.
Let’s say I click TextBox1, and then I press Button1, then “1” will only appear in TextBox1
If instead, I click TextBox2, and then I press Button1, then “1” will only appear in TextBox2 instead.
Any simple operation? I have not much knowledge, I hope my explanation makes sense. This is for VB.net. Please explain answer very simply.
I tried something like ….
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
Dim intNumberCalc As String
intNumberCalc = TextBox1.Text
Select Case intNumberCalc
Case 1
If Button1.PerformClick Then
TextBox1.Text = “1”
Which, even I admit is never going to work but I just tried. I really can’t figure out how to make the button1 press only input on the textbox i clicked on.
Ducko Uranus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.