View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] mdupris@hotmail.com is offline
external usenet poster
 
Posts: 27
Default Find the name of the label within its _Click() ?

Nick,

You're right about this being a solution -- although it's more than
a bit of a kludge. It would really change the whole GUI design of the
application but it may be the way to go (sigh). Thanks for your
thoughts here.



NickHK wrote:
Not exactly what you want, but text box can be made to look like labels.
Also with .Locked=true they can be edited, but can be selected, hence made
active.

NickHK

wrote in message
ups.com...
This is one of those "there's gotta be a way" situations. I have a
UserForm with objects all over it, including a multipage form, frames
within the pages and objects, including labels, within the forms and on
the pages directly. I'd like to implement a "right click for help"
routine for all the objects including labels, since some of the labels
are designed to look and feel like hyperlinks and do perform (hopefully
useful) actions for the user. The "HelpContextID" for all objects,
including labels, has been defined.

One obvious place to start is the "MouseUp()" event and use "If Button
= 2 ...". However, from there I'm stuck. With labels, the ActiveControl
object (or in my case, the
(Me.mpgMain.SelectedItem.ActiveControl.ActiveContr ol) object is NOT the
object whose "MouseUp()" macro is being run. Rather it's the textbox
where the cursor is sitting there blinking. Does anyone know a way to
refer to the object whose MouseUp event is being called from within the
MouseUp event itself? From there I could extract the HelpContextID
property and do a 'Shell "winhlp32.exe -N ...'

Alternately does anyone know a simpler way of having a right mouse
click bring up the context-sensitive help, equivalent to how the "F1"
key works, for all types of objects oon a UserForm? It seems this used
to a standard feature in older versions of Excel/Windows but, sigh, no
longer.

= Marchand =