C# Focus Issues - Touch Screen - User Controls - Button Control - TextBox 
Author Message
 C# Focus Issues - Touch Screen - User Controls - Button Control - TextBox

I am developing a point-of-sale touch screen application. I am having severe
issues with focus between controls.

Some of the forms on the application have several textboxes for data entry.
To facilitate touch-screen data entry, I have created an alphabet user
control with 26 buttons. When a user presses a button, I want for the
application to add the alphabetic character to the textbox which had focus
when the button control was pressed.

My problem is that I don't know how to determine which control (specifically
which textbox control) had focus before a button on my alphabet user control
was pressed. I need to know this information I think to return the text (and
perhaps the focus) back to that (textbox) control.

I would like to get around having to rewire the LostFocus event on every
textbox control. I prefer a solution that is generic that can be easily
added to work with all my forms.

I would also like to prevent the button controls on my alphabet user control
from gaining focus.

Please help! Thank you very much!


nospam.)

Regards,

Anthony Gatlin



Sun, 05 Jun 2005 07:17:26 GMT  
 C# Focus Issues - Touch Screen - User Controls - Button Control - TextBox
Maybe not the answer you want, but the way I would go about it would be
this.

1. Declare a string variable at the class scope named 'strFocusedTextbox'
2. on each textbox's GotFocus event, write the name of that textbox in the
'strFocusedTextbox' variable
3. Then when the user clicks on the buttons to insert text, the code would
be the same for all of them, just append text to the textbox who's name is
stored in strFocusedTextbox.

I suppose an implementation you mentioned on LostFocus would be similar, but
Gotfocus seems to make more sense to me.  Either way, it's the most
straight-forward way I can think of to reliably do that.

Hope this helped,
Craig


Quote:
> I am developing a point-of-sale touch screen application. I am having
severe
> issues with focus between controls.

> Some of the forms on the application have several textboxes for data
entry.
> To facilitate touch-screen data entry, I have created an alphabet user
> control with 26 buttons. When a user presses a button, I want for the
> application to add the alphabetic character to the textbox which had focus
> when the button control was pressed.

> My problem is that I don't know how to determine which control
(specifically
> which textbox control) had focus before a button on my alphabet user
control
> was pressed. I need to know this information I think to return the text
(and
> perhaps the focus) back to that (textbox) control.

> I would like to get around having to rewire the LostFocus event on every
> textbox control. I prefer a solution that is generic that can be easily
> added to work with all my forms.

> I would also like to prevent the button controls on my alphabet user
control
> from gaining focus.

> Please help! Thank you very much!


> nospam.)

> Regards,

> Anthony Gatlin



Sun, 05 Jun 2005 09:38:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to switch off focus bitmap on buttons for touch screen app

2. focus issue with tree control

3. Horrible user control bug stripped all user controls from my project

4. user mode issue for a composite listview control

5. User control not to receive focus

6. Issue with progmatically inserted user controls

7. Identifying which control lost focus on button click event

8. Web Browser Control Focus and Tab C#

9. Radio Button focus issue.

10. Pass control-focus to control from a manager class

11. Need to control when a control gets the focus on a dialog

12. CListCtrl: The List Control de-highlights when the control loses focus

 

 
Powered by phpBB® Forum Software