Protected WithEvents btnSearch As Button
Protected Overrides Sub CreateChildControls()
    btnSearch = New Button
    btnSearch.Text = "Search"
    Controls.Add(btnSearch)
End Sub

Example 2: Creating child controls.

Back to Article