Solved

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

Posted on 2009-07-04
6
512 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

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.

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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.
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…

777 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