EnsureChildControls

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I am creating a custom control and I have the following:

Protected Overrides Sub CreateChildControls()

With MyBase.Controls
.Add(Panel1)
....
End With

MyBase.CreateChildControls()
MyBase.EnsureChildControls()
Me.ChildControlsCreated = True

End Sub

Is EnsureChildControls needed?

Thanks,
Miguel
 
no. ensurechildcontrols calls createchildcontrols is it has not been
called yet. You normally call EnsureChildControls if you need to set
properties on them. This allows the create to be deferred as long as
possible.

-- bruce (sqlwork.com)
 
Back
Top