I have several textboxes (name, address, etc) to be filled in by typing on a keyboard. I have a keyboard routine that gets fired with each press ogf a key:
if (selector==1) TestTexBox1.Text = TestTexBox1.Text + nuchar; //append incoming to textbox1
if (selector == 2) TestTexBox2.Text = TestTexBox2.Text + nuchar; //append incoming to textbox2
if (selector == 3) TestTexBox3.Text = TestTexBox3.Text + nuchar; //append incoming to textbox3
}[/quote]
However, since there are many textboxes it seems a bit backwards to try to figure out where to send the chars (to various textboxes) from within this routine, perhaps by setting a selection parameter in the main routine. Is this the proper arrangement?
Cant give you a solution, but yep that seems the wrong approach. Take a look at something like Pyxis2 or even Glide and see how they do it - you should find they have a similar issue with their soft keyboard.
Thanks, I may take a look, though that’s a big ship to crawl around. My understanding is that each routine that sets up a textbox must subscribe to the CharDown event, its just not clear how that event knows where to put the data (unless i cheat and just directly tell it where, as I showed). Does sender provide this location?
The way I approach it is to have a “focused” object on a form. So when input comes in it is directed to that object. If the object is null the event bubbles up to be caught elsewhere.