
Create custom control change property default
Hello,
Thank you for using the Microsoft Newsgroups.
You can add the code to New() subroutine. The code looks like:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim t As New mytextbox()
t.Left = 20
t.Top = 20
t.Width = 100
t.Height = 30
t.Visible = True
Me.Controls.Add(t)
End Sub
Public Class mytextbox
Inherits TextBox
Public Sub New()
Me.Text = "default text"
End Sub
End Class
If you have any questions, please reply to this post.
Regards,
Jian-Wei Yu
Microsoft Support
This posting is provided "AS IS" with no warranties, and confers no rights.