G
Glyn Meek
I'm sure this is a simple thing to do, and I should know it...but I don't,
so any help would be appreciated.
I have two controls on a form, one is a listview, one is a text box. I
normally accept the entries into the textbox one keystroke at a time through
a user defined event handler for 'keypressed', and the textbox has 'focus'
(i.e. the cursor sits in the textbox at the end of the entered text.)
The user can click on the listview box at any time, and then I recognize the
selected item and go off and process this in an event handler for
'selectedindexchanged'. After processing this event, I then want the focus
to go back to the textbox and to have the cursor once more sitting flashing
at the end of the entered text, waiting for use input of the next
character...
BUT...I can't figure out how to get this focus back to the textbox.
I have tried making the last statement in the listview
'selectedindexchanged' event handler to be
textbox.focus()
(Actually, I think I've tried every event I can for the textbox......but
nothing seems to work, focus still remains in the listview control)
but this has no effect. The only way I can do it is to 'click' on the
textbox with the mouse after the listview event has been handled, but this
is 'unfriendly' for the user.
What am I missing here.
regards
Glyn J Meek
so any help would be appreciated.
I have two controls on a form, one is a listview, one is a text box. I
normally accept the entries into the textbox one keystroke at a time through
a user defined event handler for 'keypressed', and the textbox has 'focus'
(i.e. the cursor sits in the textbox at the end of the entered text.)
The user can click on the listview box at any time, and then I recognize the
selected item and go off and process this in an event handler for
'selectedindexchanged'. After processing this event, I then want the focus
to go back to the textbox and to have the cursor once more sitting flashing
at the end of the entered text, waiting for use input of the next
character...
BUT...I can't figure out how to get this focus back to the textbox.
I have tried making the last statement in the listview
'selectedindexchanged' event handler to be
textbox.focus()
(Actually, I think I've tried every event I can for the textbox......but
nothing seems to work, focus still remains in the listview control)
but this has no effect. The only way I can do it is to 'click' on the
textbox with the mouse after the listview event has been handled, but this
is 'unfriendly' for the user.
What am I missing here.
regards
Glyn J Meek