View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default refedits in a userform control class

Robert,

Thanks. As often happens, I was half-way there. I set the labels with
accelerators, just as you described, partly because that was the way to show
the underlined keys. I even tried it to see if you would behave as you
said. Only thing is... I didn't fix the tab order. Now that I have it
works perfectly, and I can delete a couple of hours worth of code.

Ah well, it's a cheap hobby!

Thanks again,

Doug


"Robert Bruce" <rob@analytical-dynamicsdotcodotukay wrote in message
...
Roedd <<Doug Glancy wedi ysgrifennu:


I'm working on a userform with some RefEdit controls. I found, I
believe, that there's no way to have an accelerator key for a
RefEdit, so I thought I'd create one by creating a refedit control
class and defining a KeyDown event.


Sorry to butt in so late, but you appear to be heading in the wrong
direction.

To define an accelerator for a refedit (or textbox or other control with
no
caption), place a label on the form next to the refedit, give it a caption
describing the refedit ("Data Range", for example), set the label's
accelerator and then ensure that the label is directly before the refedit
in
the form's tab order. Because a label without an associated event can't
take
focus, the next control in the tab order takes it when the accelerator is
activated.

--
Rob

http://www.asta51.dsl.pipex.com/webcam/

This message is copyright Robert Bruce and intended
for distribution only via NNTP.
Dissemination via third party Web forums with the
exception of Google Groups and Microsoft Communities
is strictly prohibited and may result in legal action.