View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
onedaywhen onedaywhen is offline
external usenet poster
 
Posts: 459
Default I may have found (yet another) bug in Excel

How about using another control, one with a HelpContextID you can
actually use, and make it look like a label?

--

(DennisE) wrote in message ...
Thanks much for responding to my inquiry. It is true
enough that a label cannot take a focus and hence no way to
summon help by pressing the <F1 key. What I was trying to do
is to develop my own help system wherein by clicking on the
label, a call to my own help subroutine, say HelpMe (N), would be
issued with the label's HelpContextID parameter serving to identify
where the call came from. For example,

Sub UserForm1.Label1_Click()
HelpMe UserForm1.Label1.HelpContextID
End Sub

As is now verified, that won't work, so my workaround
has been to simply to change the code to read:

Sub UserForm1.Label1_Click()
HelpMe UserForm1.TextBox1.HelpContextID
End Sub

In this manner, users can bring up a help screen in
either of two ways: by pressing <F1 while the
insertion point is in the TextBox (as it has the focus),
or by clicking on the label next to the TextBox. The
coding is very easy as I've made sure that all TextBoxes
and their corresponding Labels are similarly named
(that is Label34 goes with TextBox34, etc.).

-- Dennis Eisen