<p>I was wondering if someone would be able to help me write a CQL query for NDepend that will show me all the methods in my form class that handle the form events.  So I would like to be able to find all the methods that look like this:</p>

<pre><code>Private Sub AddFolderButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddFolderButton.Click
</code></pre>

<p>I have had a look through some of the options but I can't really find anything that does what I need.</p>

<p>I have only just started using NDepend, so I haven't really got used to it yet, but I do know one thing how the hell did I live without it all this time.</p>

I have sort of got something that works but its not really 100% correct, because all the form generated event handlers have an underscores in there name, I used the underscore as a filter,  I also filter where the name has "EventArgs" in it.  The query looks like this:
```
```
SELECT METHODS WHERE NameLike "_" OR NameLike "EventArgs" AND !IsSpecialName AND IsPrivate
```
```
That query pretty much returns all the methods that handle events but I would still like to find a more correct way.