Dialog: how let user immediately start typing a desired option?

Started by pguild, May 07, 2019, 06:03:45 PM

Previous topic - Next topic

pguild

In an item list box in a dialog, the user must press Tab before typing an option, or click somewhere in the item list box before typing.

When presented with the item list box, I would like the user to be able to immediately start typing the first few letters of the desired option such that the selection bar jumps to the first option that matches her typing.
I'm thinking that a call back function could enable that, but not sure what to do.
www.DogTrainingPsychology.com -- "Don't wish it were easier, wish you were better."  as aphorism by Jim Rohn as quoted in the Kindle Book, GEMS OF WISDOM by Philip Seyer

td

If you give the listbox the lowest tab order number in the dialog it will receive the input focus when the dialog displays.  ItemBox controls automatically select the item the begins with the letter type when the control has the focus.  However, once an item is selected, it will not select another item by typing a different letter.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Also, might suggest taking a look at DialogControlState() and read through that function info as well as all the other DialogControl...() functions, if you haven't.

Jim

pguild

td -- i'm not sure what you mean by "once an items is selected."  If I have these items in a list box

Adobe
Affiliate
Agility

When I press TAB and type "ag" the selection bar will jump to Agility or if I click Adobe and type "ag" the selection bar will do the same.
So it seems, from what you are saying, I cannot get the jumping behavior like this without pressing TAB first or clicking somewhere into the list? ???
www.DogTrainingPsychology.com -- "Don't wish it were easier, wish you were better."  as aphorism by Jim Rohn as quoted in the Kindle Book, GEMS OF WISDOM by Philip Seyer

td

You can't select another item using the first letters of an item once an item has been selected using a key press without first removing and reestablishing the input focus on the control.  This is how Microsoft designed the Common Control to work.  You could kludge something with a dialog callback to automatically remove and add the input focus when a selection is made but that could have visual artifacts that could annoy or confuse the user.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

You could also take a look at the REPORTVIEW control.  It allows you to select items in the first column of the control after an item has been selected without having to first remove and add the input focus.  The thing to remember with this control is to initially have an item selected for key-based selection to work.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade