How to Dynamically add control to DesktopPagePanel?

On a DesktopWindow, I am trying to add a custom subclassed DesktopCanvas control on to a DesktopPagePanel. When the control is added, it shows on the window but not on the PagePanel. Basically, it seems like it is on top of the PagePanel since you can see it regardless of the panel that is selected.

I tried setting the parent to the panel and the panel index but it doesn’t work. Any ideas?

Here is the code that is in a method on the DesktopWindow:

var oErrorIndicator as New EximErrorIndicator

oErrorIndicator.Tooltip = sErrorMessage
oErrorIndicator.Left = iLeft
oErrorIndicator.Top = iTop
oErrorIndicator.Width = 16
oErrorIndicator.Height = 16

'add the panel and panel index to the control
oErrorIndicator.Parent = Panel
oErrorIndicator.PanelIndex = iPanelIndex

self.AddControl oErrorIndicator

Have to tried EmbedWithin rather than AddControl ?

Self” in a DesktopWindow references to the DesktopWindow as the current main class, this is why the control is placed on top of all…