I am currently having a problem with resizing controls written in C# when they are in a floating window. I have discovered that the issue is with CreateControl - the code currently passes the main application window in as the parent. With C# controls, this means that they will only redraw themselves up to the size of their parent window. This is only an issue when they are contained in a floating window which resizes larger than the main application window.
My attempted solution was to pass in the CXTPDockingPaneTabbedContainer* as the parent window. If the pane starts out floating, then this solution actually works. If the pane starts docked, and is made floating, this causes huge problems. The docked pane is destroyed when it is floated, which then destroys any controls which listed it as their parent. I have tried forcing the C# controls to set their parent to the main application window before the float occurs, then setting the parent back to the floating container, but this doesn't work - the controls are still destroyed. I should mention that if I pass in the application window to CreateControl, then do a SetParent afterwards with the tabbed container, the controls still redraw incorrectly. Is their any way to allow the C# controls to use the tabbed container as their parent for redrawing? This might fundamentally be an MFC issue, and I just don't understand some small step that is necessary to switch the container for an ActiveX control. Either way, I appreciate any help you can provide.
Thanks, Michael Zuber
|