Print information when ANY control is used

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

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
exist.

Thanks
 
Tom,

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
routine.

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

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top