To reproduce: - Add RadWizard to a form. - Set the AcceptButton property like this: this.AcceptButton = this.radWizard1.NextButton; - You will notice that nothing happens when the enter key is pressed. Workaround: - Use the following PreviewKeyDown event handler: void radWizard1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.Enter) { this.radWizard1.NextButton.PerformClick(); } }
Sub New()
InitializeComponent()
Me.AcceptButton = Me.RadWizard1.NextButton
AddHandler Me.RadWizard1.Cancel, AddressOf radWizard1_Cancel
AddHandler RadWizard1.Finish, AddressOf radWizard1_Finish
AddHandler Me.RadWizard1.SelectedPageChanged, AddressOf RadWizard_SelectedPageChanged
End Sub
Private Sub RadWizard_SelectedPageChanged(sender As Object, e As SelectedPageChangedEventArgs)
If e.SelectedPage.Name = Me.WizardCompletionPage1.Name Then
Me.AcceptButton = Me.RadWizard1.FinishButton
Else
Me.AcceptButton = Me.RadWizard1.NextButton
End If
End Sub
Private Sub radWizard1_Cancel(ByVal sender As Object, ByVal e As EventArgs)
Me.Close()
End Sub
Private Sub radWizard1_Finish(ByVal sender As Object, ByVal e As EventArgs)
Me.Close()
End Sub
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
When I extend this logic to include the Finish button I get an error when I select Enter to activate the Finish button PerformClick event
This is the error:
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.WinControls.UI.RadWizard.ProcessDialogKey(Keys keyData)
This is the code I used :