how to remove container control that has been embed into a tab panel?

Hi,

i am currently working an application where i have 2 similar container control that has a htmlviewer which is embed using ‘ContainerControl.EmbedWithinPanel’.

my question is how do i remove them from the tab panel??

currently i am doing the following but although ccHTMLViewerGT is nil in the debug mode, the container control is still display in the tab panel.

    IF ccHTMLViewerGT<>NIL then 
      ccHTMLViewerGT.HTMLViewer1.height=0
      ccHTMLViewerGT.HTMLViewer1.width=0
      ccHTMLViewerGT.HTMLViewer1.Visible=false
      ccHTMLViewerGT.height=0
      ccHTMLViewerGT.width=0
      ccHTMLViewerGT.Visible=false
      ccHTMLViewerGT=nil
    END IF

Call ccHTMLViewer.Close

it crash if i put that instead of all the other.

HTMLViewer has always been touchy. You might want to try making it it invisible, move it way off screen, and THEN do an official close.

Otherwise, I’d say it’s a bug so report with an appropriate sample project.

is it ok to have 2 different htmlviewer in one tab panel??

Usually not

thanks everyone… i got everything working now.

Instead of 2 htmlviewer, i have container control with htmlviewer. i used the ContainerControl.EmbedWithinPanel. And instead of having the textarea for the html code under the htmlviewer, i put it on another tab panel and it work really nice now.

[quote=45312:@Richard Duke]thanks everyone… i got everything working now.

Instead of 2 htmlviewer, i have container control with htmlviewer. i used the ContainerControl.EmbedWithinPanel. And instead of having the textarea for the html code under the htmlviewer, i put it on another tab panel and it work really nice now.[/quote]
If I am right about what you are trying to do. Try calling the remove function from the array as appose to assigning the object to nil. So instead of this:

ccHTMLViewerGT=nil

Use:

TheTabPanel.Remove(TheTabPanel.IndexOf(ccHTMLViewerGT))

Hope this helps. I probably do not even know what you are trying to do.

i don’t really want to remove tab panel, just the ccHTMLVIewerGT in the tab panel.

Where did you declare your Container Control? It sounds like you have you’ve used Dim then having it a property of the window so you can “access” it later.

since i need the these 2 container control, i declare on the window i am using.