I am using VB 2010. I have 20 TextBox controls in my form. I turned them to TextBox array.
Here is the code:
Dim TbArray(19) As TextBox
Private Sub Form7_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
TbArray(0) = TextBox1
TbArray(1) = TextBox2
...
TbArray(19) = TextBox20
It works properly. I want my program to select all the text on the TextBox control which got focused.
How can i know which TextBox control has been selected? I mean there is no Private Sub TbArray(i)_GotFocus in the dropdown menu of vb designer.
To expound on what Akram said,