I am attempting to practically do an example laid out in my textbook which is related to extending a control.
I have made a new Windows Application Project and written the following:
However the "myn.Clear" function is giving me a syntax error: Declaration expected.
I would like to know:
1. What type of project should I make if I want to extend a control?
2. Where should my code be written so that there will not be problems like the one I am currently facing?
I have made a new Windows Application Project and written the following:
Public Class numerictextbox
Inherits System.Windows.Forms.TextBox
Protected Overrides Sub onkeypress(ByVal e As System.Windows.Forms.KeyPressEventArgs)
End Sub
Dim myn As New numerictextbox
myn.clear
End Class
However the "myn.Clear" function is giving me a syntax error: Declaration expected.
I would like to know:
1. What type of project should I make if I want to extend a control?
2. Where should my code be written so that there will not be problems like the one I am currently facing?