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?
Expand|Select|Wrap|Line Numbers
- public class myDateTextBox : AMS.TextBox.DateTextBox
- {
- protected override bool ProcessDialogKey(Keys keyData)
-
{
if (keyData >= Keys.NumPad0 && keyData <= Keys.NumPad9)
- {
- return true;}return base.ProcessDialogKey(keyData);
- }}
I try something like this, but it dosen't work.
Expand|Select|Wrap|Line Numbers
- public class x
-
{ // ...
private void textBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9)
- {
- textBox.Text = Convert.ToString(e.KeyData);}}}