I want to get the focus of the objects inside a form and know if they are of type text or if they are of type text, like richtextbox,textbox,wordwrap I can control an event in them created by code, because I will do 5 per code to control but I intend to do it but then I made the following code:
The code above counts the elements that are inside a form to be unlimited the items now I need to capture the keydown event of these elements without being created is it possible or create a keydown event for it?
Code:
' captures all form events
For Each formcontrols As Control In Me.Controls
If formcontrols.HasChildren then
''''MsgBox(formcontrols.Controls.Count, MsgboxStyle.OkOnly,"Count Element intro")
'captures whatever textbox there are and finds which one has the focus
For Each textboxbycode As TextBox In Me.Controls
If textboxbycode.focus then
' here the idea is to capture the keydown event
End if
End If
Next