Accelerator key takes 2 tries to open combobox
Author |
Message |
Mark Tangar #1 / 5
|
 Accelerator key takes 2 tries to open combobox
Hi Gang, I have a form with a simple combobox, and just before it in the tab order is a label. The label has an Accelerator key assigned ("T"). But for some reason the label won't give the focus to the combobox on the first attempt at pressing ALT+T. Instead, it beeps. If I press ALT+T again, the combobox wakes up and takes the focus, but never on the first try. Why?? There aren't many other controls on the form at all, and they're all just commandbuttons and labels. The combobox could hardly be simpler (3 entries, 1 column, listbox style). The combobox is never made non-Enabled or non-Visible. There are no other label-and-control pairs. All other accelerator-ized controls use other letters and work fine. The accelerator character *does* occur in the label, I've double-checked. And I don't have ALT+T assigned to anything else in any other way. What could possibly be causing this hesitation? Thanks, as always. Mark
------ WWW: http://www.*-*-*.com/ ~mtangard ---------------------- ------------- "Life is nothing if you aren't obsessed." --John Waters ---------------------------------------------------------------------
|
Sun, 30 Nov 2003 21:50:53 GMT |
|
 |
Mark Tangar #2 / 5
|
 Accelerator key takes 2 tries to open combobox
I solved this, but I don't know entirely how. There were 2 *frames* in the form, and both were set with the TabStop property = True. I de-Trued them and the problem went away. If anyone would care to explain this, I'm all ears. In fact, any kind of mini-tutorial on why frames exist (other than for option buttons, which these weren't holding) would be welcome. Mark Quote:
> Hi Gang, > I have a form with a simple combobox, and just before it in the tab > order is a label. The label has an Accelerator key assigned ("T"). > But for some reason the label won't give the focus to the combobox > on the first attempt at pressing ALT+T. Instead, it beeps. If I > press ALT+T again, the combobox wakes up and takes the focus, but > never on the first try. > Why?? > There aren't many other controls on the form at all, and they're > all just commandbuttons and labels. The combobox could hardly > be simpler (3 entries, 1 column, listbox style). The combobox > is never made non-Enabled or non-Visible. There are no other > label-and-control pairs. All other accelerator-ized controls use > other letters and work fine. The accelerator character *does* occur > in the label, I've double-checked. And I don't have ALT+T assigned > to anything else in any other way. > What could possibly be causing this hesitation? > Thanks, as always. > Mark
> ------ WWW: http://www.speakeasy.org/~mtangard ---------------------- > ------------- "Life is nothing if you aren't obsessed." --John Waters > ---------------------------------------------------------------------
|
Sun, 30 Nov 2003 23:15:50 GMT |
|
 |
Perr #3 / 5
|
 Accelerator key takes 2 tries to open combobox
Hi Mark, That's because a Frame (likewise a Multipage) are Container objects. From a developer's point of view, t's desirable to have OnEnter events or TabStop properties being assigned to, in order to manipulate it's child controls. Debug print the parent name of a control placed in a frame and see what's printed. Kind regards, Perry
Quote: > I solved this, but I don't know entirely how. There were 2 *frames* > in the form, and both were set with the TabStop property = True. > I de-Trued them and the problem went away. > If anyone would care to explain this, I'm all ears. In fact, any > kind of mini-tutorial on why frames exist (other than for option > buttons, which these weren't holding) would be welcome. > Mark
> > Hi Gang, > > I have a form with a simple combobox, and just before it in the tab > > order is a label. The label has an Accelerator key assigned ("T"). > > But for some reason the label won't give the focus to the combobox > > on the first attempt at pressing ALT+T. Instead, it beeps. If I > > press ALT+T again, the combobox wakes up and takes the focus, but > > never on the first try. > > Why?? > > There aren't many other controls on the form at all, and they're > > all just commandbuttons and labels. The combobox could hardly > > be simpler (3 entries, 1 column, listbox style). The combobox > > is never made non-Enabled or non-Visible. There are no other > > label-and-control pairs. All other accelerator-ized controls use > > other letters and work fine. The accelerator character *does* occur > > in the label, I've double-checked. And I don't have ALT+T assigned > > to anything else in any other way. > > What could possibly be causing this hesitation? > > Thanks, as always. > > Mark
> > ------ WWW: http://www.speakeasy.org/~mtangard ---------------------- > > ------------- "Life is nothing if you aren't obsessed." --John Waters > > ---------------------------------------------------------------------
|
Mon, 01 Dec 2003 04:50:58 GMT |
|
 |
Mark Tangar #4 / 5
|
 Accelerator key takes 2 tries to open combobox
Quote:
> Debug print the parent name of a control placed in a frame > and see what's printed.
Perry, thanks, but I'm a little fuzzy on Debug.Print. I can't seem to get the parent name accepted in code. Parent doesn't have a a Name property. What am I missing? Mark
|
Mon, 01 Dec 2003 14:19:07 GMT |
|
 |
Perr #5 / 5
|
 Accelerator key takes 2 tries to open combobox
Hi Mark, Quote: > a Name property. What am I missing?
Heh ??? Beats me. Situation: UserForm1, Frame1. TextBox1 is placed in Frame1 of course ... Private Sub UserForm_Click() Debug.Print "TextBox1 name: " & Me.TextBox1.Name Debug.Print "Frame1 name: " & Me.Frame1.Name Debug.Print "textbox1 parentname: " & TextBox1.Parent.Name End Sub Resulted into: TextBox1 name: TextBox1 Frame1 name: Frame1 textbox1 parentname: Frame1 Kind regards, Perry
Quote:
> > Debug print the parent name of a control placed in a frame > > and see what's printed. > Perry, thanks, but I'm a little fuzzy on Debug.Print. I can't seem > to get the parent name accepted in code. Parent doesn't have a > a Name property. What am I missing? > Mark
|
Wed, 03 Dec 2003 19:01:27 GMT |
|
|
|