By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

Print information when ANY control is used

P: n/a
I have an application with hundreds of controls that has
an error that is difficult to reproduce. I would like to
instrument the software to trace everything the user does
so I can reproduce it. How can I write selected
information to a file each time the user uses ANY
control? (I mainly have buttons, textboxes and
comboboxes.) I would like to do this without explicitly
writing a handling routine for each control and also
without disturbing the handling routines that already

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a

You can create an event in a recursive loop for an event that you are not
using and know that it is firing by instance Enter (which does not fire for
a button, therefore search for that what fits you the best)

The events for that you can build in one time by instance using this

Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub doSet(ByVal parentCtr As Control)
Dim ctr As Control
For Each ctr In parentCtr.Controls
AddHandler ctr.Enter, AddressOf meEnter
End Sub

I hope this helps,

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.