Hi,
I'm using RadDatetimePicker RadWinForm Q3 2011 . My problem is KeyDown event doesn't fire when user press "Enter". How can i solve this problem .
my code is :
Private Sub IctDateTimePicker1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles IctDateTimePicker1.KeyDown
If e.KeyCode = Keys.Enter Then
SendKeys.SendWait("{TAB}")
End If
End Sub
Best Regards,
Kenghot
I'm using RadDatetimePicker RadWinForm Q3 2011 . My problem is KeyDown event doesn't fire when user press "Enter". How can i solve this problem .
my code is :
Private Sub IctDateTimePicker1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles IctDateTimePicker1.KeyDown
If e.KeyCode = Keys.Enter Then
SendKeys.SendWait("{TAB}")
End If
End Sub
Best Regards,
Kenghot
6 Answers, 1 is accepted
0
kenghot
Top achievements
Rank 1
answered on 26 Jan 2012, 05:35 AM
Pleazzzz !! I need help
0
Hello Kenghot,
You should handle KeyPress event instead of KeyDown event because the Enter key is processed in different way. Consider the sample below:
I hope it helps. Don't hesitate to contact us, if you have further questions.
Kind regards,
Peter
the Telerik team
You should handle KeyPress event instead of KeyDown event because the Enter key is processed in different way. Consider the sample below:
Private
Sub
IctDateTimePicker1_KeyPress(
ByVal
sender
As
Object
,
ByVal
e
As
System.Windows.Forms.KeyPressEventArgs)
Handles
IctDateTimePicker1.KeyPress
If
Asc(e.KeyChar) = 13
Then
SendKeys.SendWait(
"{TAB}"
)
End
If
End
Sub
I hope it helps. Don't hesitate to contact us, if you have further questions.
Kind regards,
Peter
the Telerik team
SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).
0
Shoshana
Top achievements
Rank 1
answered on 20 Feb 2013, 06:16 AM
Hi,
I'm using RadDatetimePicker RadWinForm Q2 2011 .
My problem is KeyDown/KeyPress events doesn't fire when user press "Delete". How can i solve this problem ?
I tried override and subscribe, but its doesn't work
Please, I need help!
Thanks in advance
Shoshana
I'm using RadDatetimePicker RadWinForm Q2 2011 .
My problem is KeyDown/KeyPress events doesn't fire when user press "Delete". How can i solve this problem ?
I tried override and subscribe, but its doesn't work
Please, I need help!
Thanks in advance
Shoshana
0
Hi Shoshana,
Thank you for contacting Telerik support.
You should handle the hosted textbox control KeyDown Event:
I hope this helps.
All the best,
Peter
the Telerik team
Thank you for contacting Telerik support.
You should handle the hosted textbox control KeyDown Event:
this
.radDateTimePicker1.DateTimePickerElement.TextBoxElement.TextBoxItem.HostedControl.KeyDown +=
new
KeyEventHandler(HostedControl_KeyDown);
void
HostedControl_KeyDown(
object
sender, KeyEventArgs e)
{
}
All the best,
Peter
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Shoshana
Top achievements
Rank 1
answered on 26 Feb 2013, 06:48 AM
Hi,
Thanks for your reply,
but this code works only when subscribe to the event out of the DateTime class,
but when I write this code, its does not work
I'd be happy to use your help again,
Shoshana
Thanks for your reply,
but this code works only when subscribe to the event out of the DateTime class,
but when I write this code, its does not work
public
DateTimePickerBaseTest()
:
base
()
{
this
.DateTimePickerElement.TextBoxElement.TextBoxItem.HostedControl.KeyDown +=
new
KeyEventHandler(HostedControl_KeyDown);
}
void
HostedControl_KeyDown(
object
sender, KeyEventArgs e)
{
if
(e.KeyData == System.Windows.Forms.Keys.Delete)
{
this
.SetToNullValue();
//this.OnNotifyPropertyChanged("BindableValue");
e.Handled =
true
;
}
else
base
.OnKeyDown(sender, e);
}
I'd be happy to use your help again,
Shoshana
0
Hi Shoshana,
Thank you for writing back.
I guess at this point the textbox is not yet initialized. I would like to recommend you to subscribe to the event in the OnLoad override:
I hope this helps.
Greetings,
Peter
the Telerik team
Thank you for writing back.
I guess at this point the textbox is not yet initialized. I would like to recommend you to subscribe to the event in the OnLoad override:
protected
override
void
OnLoad(System.Drawing.Size desiredSize)
{
base
.OnLoad(desiredSize);
this
.DateTimePickerElement.TextBoxElement.TextBoxItem.HostedControl.KeyDown +=
new
KeyEventHandler(HostedControl_KeyDown);
}
I hope this helps.
Greetings,
Peter
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.