tags:

views:

648

answers:

2

When I add the textBox.TextChanged to watch list I get a message saying

The event 'System.Windows.Forms.Control.TextChanged'
can only appear on the left hand side of += or -=

Is there any way to check what event's are called on text change?

+1  A: 

In the debugger, open up the control and find whichever private variable contains the EventHandlerList. Then find the event add/remove code for TextChanged so see which key is used - and examine the event handler list's entry for that key.

It's painful, but it should work.

Jon Skeet
For info, the key is `EventTextChanged`
Marc Gravell
+1  A: 

Not really; events are, by design, a closed box. There are hacky ways of getting at it, but they all require incestuous knowledge of the implementation (be it a field-like event, or an EventHandlerList, etc).

Why do you need this?

One other approach might be to get the TextBox pdb from the MS symbol server so you can add a breakpoint (to OnTextChanged) and step through the TextBox code, and step into the delegate invoke... again, not ideal.

Marc Gravell