Disallow entry from numeric keyboard to custom date text box and pass entry to text box
Can someone help me with custom text box?
I want change behavior custom date text box - disallow entry and pass entry from numeric keyboard to a text box. Code below disallow entry, but how I can pass entry?
public class myDateTextBox : AMS.TextBox.DateTextBox
{
protected override bool ProcessDialogKey(Keys keyData)
{
if (keyData >= Keys.NumPad0 && keyData <= Keys.NumPad9)
{
base.ProcessDialogKey(keyData);
return true;
}
return base.ProcessDialogKey(keyData);
}
}
I try something like this, but it dosen't work.
public class x
{
// ...
myDateTextBox order;
TextBox textBox;
private void order_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9)
{
textBox.Text = Convert.ToString(e.KeyData);
}
}
}
Thanks in advance for any help.