Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15476

VS 2019 Vb.net Discover selected focus item keydown

$
0
0
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:

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

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?

Viewing all articles
Browse latest Browse all 15476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>