Solved

Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

Posted on 2009-07-04
6
514 Views
Last Modified: 2013-11-08
Getting an error "Handles clause requires a WithEvents variable defined in the containing type or one of its base types." in vb application for a spell checker.
error2.bmp
0
Comment
Question by:kor786
  • 3
  • 3
6 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 24776417
How have you declared "SpellCheck"? It should be declared at class level (ie, outside of any routines) as described in the error....

    Private WithEvents SpellChecker As NetSpell.SpellChecker.Spelling

Wayne
0
 

Author Comment

by:kor786
ID: 24776447
yes i have
Friend SpellChecker As NetSpell.SpellChecker.Spelling
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 24776449
It should be declared "WithEvents", as I mentioned in my post above.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:kor786
ID: 24776451
if i put
    Private WithEvents SpellChecker As NetSpell.SpellChecker.Spelling
i get
'SpellChecker' is already declared as 'Friend SpellChecker As NetSpell.SpellChecker.Spelling' in this class.'
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 24776452
Simply add "WithEvents" to the already existing declaration!!
0
 

Author Comment

by:kor786
ID: 24776454
Thanks, That worked!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question