User control with two panels

  • Thread starter Thread starter Mickel Kurtis
  • Start date Start date
M

Mickel Kurtis

Hello, I need to create an user control with two Panels, and allow to insert
other controls in design time.
Im using VB 9 (VS 2008), I found code to allow the insert of controls to the
user control, but the inserts are in the control as
a container, and not the panels, I need the panels to be the containers.

<Designer("System.Windows.Forms.Design.ParentControlDesigner,
System.Design", _
GetType(IDesigner)), DefaultEvent("Click"),
DefaultProperty("Text")> _
Public Class GcCt_expander
'CODE
End Class


I need something like this code, but that allows to insert controls to each
of the panels
that the User control has.

Thank you all!
 
It may not be the most dynamic or efficient way but I would put a
method on the user control like:

public sub AddControlToPanel1(byval Ctrl as Control)
me.pnl1.controls.add(ctrl)
end sub

public sub AddControlToPanel2(byval Ctrl as Control)
me.pnl2.controls.add(ctrl)
end sub
 
Back
Top