Click here to Skip to main content
15,914,500 members
Home / Discussions / C#
   

C#

 
AnswerRe: windows not in focus Pin
dan!sh 16-Jan-10 23:20
professional dan!sh 16-Jan-10 23:20 
AnswerRe: windows not in focus Pin
OriginalGriff16-Jan-10 23:25
mveOriginalGriff16-Jan-10 23:25 
GeneralRe: windows not in focus Pin
michaelgr116-Jan-10 23:42
michaelgr116-Jan-10 23:42 
GeneralRe: windows not in focus Pin
OriginalGriff16-Jan-10 23:48
mveOriginalGriff16-Jan-10 23:48 
GeneralRe: windows not in focus Pin
michaelgr116-Jan-10 23:57
michaelgr116-Jan-10 23:57 
GeneralRe: windows not in focus Pin
OriginalGriff17-Jan-10 0:13
mveOriginalGriff17-Jan-10 0:13 
GeneralRe: windows not in focus Pin
Heinzzy17-Jan-10 0:48
Heinzzy17-Jan-10 0:48 
GeneralRe: windows not in focus Pin
MickCurley17-Jan-10 3:30
MickCurley17-Jan-10 3:30 
I can understand if you are developing a POS system you may want this input
to be directed to the textbox.

You could always try setting the KeyPreview to True on the Form.
Then on the KeyPress you could try

private void YourForm_KeyPress(object sender, KeyPressEventArgs e)
{
    ScannerFirstKeyValue = e.KeyChar.ToString();

    if (this.ActiveControl != this.YourTextBox)
    {
        YourTextBox.AppendText(ScannerFirstKeyValue);
    }
    this.ActiveControl = YourTextBox;
}


This would ensure all input is placed in correct textbox.
Remember if you have multiple textboxes this will be a problem!!
Unless the BC Reader has some sort of prefix that can distinguish it from a keyboard.

Regards
Mick Curley

Smile | :)






GeneralRe: windows not in focus Pin
Luc Pattyn17-Jan-10 4:36
sitebuilderLuc Pattyn17-Jan-10 4:36 
GeneralRe: windows not in focus Pin
Heinzzy17-Jan-10 4:57
Heinzzy17-Jan-10 4:57 
GeneralRe: windows not in focus Pin
michaelgr117-Jan-10 5:22
michaelgr117-Jan-10 5:22 
GeneralRe: windows not in focus Pin
Heinzzy17-Jan-10 5:38
Heinzzy17-Jan-10 5:38 
GeneralRe: windows not in focus Pin
michaelgr117-Jan-10 5:43
michaelgr117-Jan-10 5:43 
GeneralRe: windows not in focus Pin
Heinzzy17-Jan-10 5:50
Heinzzy17-Jan-10 5:50 
AnswerRe: windows not in focus Pin
wjp_auhtm17-Jan-10 5:27
wjp_auhtm17-Jan-10 5:27 
GeneralRe: windows not in focus Pin
michaelgr117-Jan-10 5:28
michaelgr117-Jan-10 5:28 
GeneralRe: windows not in focus Pin
wjp_auhtm17-Jan-10 18:33
wjp_auhtm17-Jan-10 18:33 
GeneralRe: windows not in focus Pin
michaelgr117-Jan-10 20:06
michaelgr117-Jan-10 20:06 
GeneralRe: windows not in focus Pin
wjp_auhtm17-Jan-10 21:24
wjp_auhtm17-Jan-10 21:24 
GeneralRe: windows not in focus Pin
michaelgr117-Jan-10 21:35
michaelgr117-Jan-10 21:35 
GeneralRe: windows not in focus Pin
wjp_auhtm17-Jan-10 21:57
wjp_auhtm17-Jan-10 21:57 
GeneralRe: windows not in focus Pin
michaelgr117-Jan-10 22:00
michaelgr117-Jan-10 22:00 
GeneralRe: windows not in focus Pin
wjp_auhtm17-Jan-10 22:26
wjp_auhtm17-Jan-10 22:26 
GeneralRe: windows not in focus Pin
michaelgr117-Jan-10 22:39
michaelgr117-Jan-10 22:39 
GeneralRe: windows not in focus Pin
wjp_auhtm17-Jan-10 22:57
wjp_auhtm17-Jan-10 22:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.