I am trying to design a calculator. I want to use the Kryptonbutton from the Krypton Component Suite. This is the code I have so far to display 0-9 in the calculator display.
Private Sub KryptonButton_Click(sender As Object, e As EventArgs) Handles KryptonButton1.Click, KryptonButton2.Click
Dim b As Button = sender
If TextBox1.Text = "0" Then
TextBox1.Text = b.Text
Else
TextBox1.Text = TextBox1.Text + b.Text
End If
End Sub
when I run the program and click the button I get the error msg : InvalidCastExecption was unhandled.
Additional Information: "Unable to cast object of type 'ComponentFactory.Krypton.Toolkit.KryptonButton' to type 'System.Windows.Forms.Button'."
the code only has the 1st two buttons right now KryptonButton1.Click, KryptonButton2.Click. The final code will have button0 thru button9
Any help or suggestion would be helpful. Thanks.