numpad issue?

I am having an issue using the numpad, and hope someone could point me in the right direction. To adjust a num data I open the numpad and link the Target to a textbox, I am then able to type a number into the pad and hit my “ok” button. My code then writes the data to the controller and seems to work fine.

The problem is every time I open the numpad after that. The cursor is usually moved over in the textbox, and I am not able to type anything until after I touch that textbox. I think I am overlooking something simple, but I have been struggling with this for a few days now. Any help would be greatly appreciated.

Thanks,

Toby

Have you tried TextBox.Focus = True when you display the NumPad?

Thanks for the quick response, Yes, I tried that, it is currently the last line in my routine, I’ll paste the code below:

this.tNumPadText.Text = “”;

tNumPadText.BackColor = Color.White;

tNumPadText.ForeColor = Color.Black;

this.numPad1.Target = this.tNumPadText;

this.tNumPadText.CaretVisible = true;

this.tNumPadText.Focus();

try adding:

this.tNumPadText.SelectAll();

and

this.tNumPadText.SelectionVisible = True;

before CaretVisible = true

That fixed it! Works great now! Thank you for your help.