Discussion:
Event for code module
(too old to reply)
pink-coder
2009-01-16 12:03:53 UTC
Permalink
I have to write an add-in that displays a message box whenever the user
clicks somewhere on the code and tells the line # e.g "This is line # 232"

I dont know what event needs to be captured and of what object. The
CodeModule object doesn't seem to have any events.

Any help ?
expvb
2009-01-16 17:17:02 UTC
Permalink
Post by pink-coder
I have to write an add-in that displays a message box whenever the user
clicks somewhere on the code and tells the line # e.g "This is line # 232"
I dont know what event needs to be captured and of what object. The
CodeModule object doesn't seem to have any events.
There are no events like this. You could use a Timer and check for changes.
If you want to do something more complicated, you have to install a hook
into the IDE. The following Addin sample does this:

Multi Tab Addin for VB6 IDE Code Editing
http://groups.google.com/group/microsoft.public.vb.addins/browse_thread/thread/699cf05630a2813e
Phill W.
2009-01-19 13:26:02 UTC
Permalink
Post by pink-coder
I have to write an add-in that displays a message box whenever the user
clicks somewhere on the code and tells the line # e.g "This is line # 232"
I'm always slightly worried when a post begins "I have to ..." or "I
need to ...". All too often, it's followed by something an "unusual"
that is either very difficult to do in VB or, in some cases, simply
shouldn't be done at all.

If we're talking about the VB6 IDE here, you already get the line (and
column) number; they're in a block at the end of the "Standard" toolbar
(reading "Ln 1, Col 1" ).

HTH,
Phill W.

Loading...