Not sure what you want, but it seems like you want to use constructor.
Class definition:
Public Class ScrollPanel
Inherits Panel
Private sText As String = "New Panel"
Public Sub New()
MsgBox(String.Concat(sText, " has been created!"), MsgBoxStyle.Information, "Message")
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub
End Class
Usage:
Dim sp As ScrollPanel = New ScrollPanel With {.Parent = Me, .Size = New Size(100, 100), .Location = New Point(80, 80), .Visible = True}
More:
Using Constructors and Destructors[
^]