Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF Unable to add event handler

$
0
0

I'v added a second form to a project (desktop app), the form displays and the Cancel button works, but trying to create the Click event for the OK button I'm getting the "Unable to add event handler" error.

One suggestion I found on the web suggested a problem with my VS install (2012, by the way) but I don't think that's the problem given the other form still works fine.

Trying to find the problem I simply typed the code for the click event which generates the "Handles clause requires a WithEvents variable defined in the containing type or one of its base types" error. In the handles clause typing the period after the OK button name doesn't generate any intellisense as it does with the other form.

And I don't see any "WithEvents" in the other form that works fine and most of what I fond on line seemed to deal with web page dev.

Any help would be greatly appreciated.

Thanks,
Ken


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>