1. Typing into a Combobox
- Posted by a.admin at myway.it Sep 03, 2004
- 451 views
Is it possible to know which keystroke has been typed into the text box of a combo before reading all the text? I mean to know in real time if an ESC or CR key have been pressed... Thanks ANTONIO
2. Re: Typing into a Combobox
- Posted by Derek Parnell <ddparnell at bigpond.com> Sep 03, 2004
- 462 views
- Last edited Sep 04, 2004
unknown wrote: > > Is it possible to know which keystroke has been typed into the text box of a > combo > before reading all the text? > I mean to know in real time if an ESC or CR key have been pressed... If you are using Win32lib its easy. There is an undocumented (sorry) routine called "getEdit" that returns the id of the combobox's edit area. You can use that to set a handler to trap keystrokes. Something along the lines of ...
procedure keytrap(integer self, integer event, sequence parms) if parms[1] = VK_ESC then . . . elsif parms[1] = VK_ENTER then . . . end if end procedure setHandler(getEdit(MyCombo), w32HKeyPress, routine_id("keytrap"))
-- Derek Parnell Melbourne, Australia
3. Re: Typing into a Combobox
- Posted by Antonio Alessi <a.admin at myway.it> Sep 04, 2004
- 446 views
Very nice; thank you, Derek. I became crazy in the attempt to trap just these two keystrokes. My name was missing may be for the hurry, but more probably for being a bit burst. Another little question, just because its you: I met an unsolved problem using a ComboBoxEx with icons, represented by the cursor. It changes into a text cursor, that is the vertical line, even to scroll and select items; I find it not suitable, at least into my program, where no change is been made to the combo content. I could not change this cursor with setMousePointer() or restoreMousePointer(). Could you? Antonio Alessi a.admin at myway.it Cecina (Italy)