Solved

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

Posted on 2009-07-04
6
509 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now