Rename fails in VB when form control has a "handled" event

Resharper VB is failing when I try to rename a control on a windows form when that control has one of it's events handled via the 'handles' keyword.

I have a naked project, one form, one listbox control. My entire code for Form1.vb is this:

Public Class Form1
Private Sub SomeHandler(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
End Sub
End Class

Now, if I put my cursor on the "Me.ListBox1" inside the Debug.print, and try to do a rename, I get a message saying that the rename could not be performed. The error itself is not helpful, but when I click it it takes me to the "Handles" point on the SUB declaration.

Posting from a news client, so not sure if the attachment will make it up.

// Andrew

1 comment
Comment actions Permalink

The rename works, except for the part that it errors on. The "handles Listbox1.blah"
does not get changed, but if you hit Next then it does take care of all the
other instances of it. Sorry for not mentioning that! I assumed you could
read my mind ;)

I haven't tested it on more complex cases, a little too worried to.

// Andrew


Please sign in to leave a comment.