This snippet is to create a user control that will only take numbers. Numbers will accept decimal values, for which the NumberBox is validated to take only one.
The implementation for the control is the same as it is for the TextBox, since it is inherited from this class and uses all of its attributes and methods:
Private Sub InitializeComponent()
'Initialize Object with the constructor for the class
'[UserControls] is the Library in which the class is created
Me.NumBox1 = New UserControls.NumberBox()
'
'NumBox1
'
Me.NumBox1.Location = New System.Drawing.Point(45, 75)
Me.NumBox1.Name = "NumberBox"
Me.Numbox1.Size = New System.Drawing.Size(100, 20)
Me.NumBox1.TabIndex = 0
'
'Form1
'
'Add Control to form
Me.Controls.Add(Me.NumBox1)
End Sub
Friend WithEvents NumBox1 As UserControls.NumberBox