EnsureChildControls

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
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Add Control 1
Render with Div Tag 1
Custom Control 3
Id and CssClass not defined 3
Property 1
Control / Property. Going crazy here. 1
Control. What am I doing wrong? 0
Button Click 1

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top