|
-
July 16th, 2001, 09:52 AM
#1
TreeView and WithEvents
Hello *,
I have an usercontrol with the following
lines of code:
private withevents LV as ListView
private withevents TV as TreeView
When I try to compile these lines I get the following error message, for the line with TreeView:
A module it not a valid type
Without that line the code can be compiled without an error message.
Any idea why I can´t declare a treeview control
with WithEvents inside an usercontrol
Thank´s
hannes
-
July 16th, 2001, 10:20 AM
#2
Re: TreeView and WithEvents
Check if you have added the component to your usercontrol (right click on toolbar, add microsoft windows common controls 6.0)
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
July 16th, 2001, 10:35 AM
#3
Re: TreeView and WithEvents
In Visual Basic 5 and 6, a code module cannot be an event sink so therefore you cannot dim anything WithEvents in a .bas module.
Try adding a global class module (.cls) and put the declaration in there. You can instantiate that class from the main .bas if you wish.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
-
July 16th, 2001, 11:00 AM
#4
Re: TreeView and WithEvents
Yes, the first thing you need to check is the component. Then try this:
Private WithEvent LV as MSComctlLib.ListView
Regards,
Michi
MCSE, MCDBA
-
July 17th, 2001, 02:25 AM
#5
Re: TreeView and WithEvents
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|