custom container controls that work at design-time?

P

PJ6

I have a simple container that I want to be able to use at design-time - as
in, be able to drag a control into it and drop it in. I already went through
of some problems in WinForms that this kind of functionality presents, so I
don't exactly need it that nice - I'd be satisfied with just manually adding
HTML in between the tags of the control. Just can't figure out how to get it
to render what's inside its tags at the moment.

TIA,
Paul
 
P

PJ6

Guess I'm starting to get this hang of this.

To create a custom web container control, inherit from HTML anchor, create a
table, add content to the middle cell, and override the render method.

Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
CC.Controls.Clear()
Dim cnts(Me.Controls.Count - 1) As System.Web.UI.Control
Me.Controls.CopyTo(cnts, 0)
For Each cnt As System.Web.UI.Control In cnts
CC.Controls.Add(cnt)
Next
tbl.RenderControl(writer)
End Sub

For some reason I can't get the border to render at design-time, but still,
this is more than I expected; design-time drag-drop works!

Paul
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top