visible = false does nothing.

I have a subclass of WebContainer as an instance on my webPage.
It is marked as not visible at start up.
When a button is pushed in my application, I set visible to true and it shows up.
When I try to dismiss the Container by setting visible to false, it simply doesn’t disappear.
What am I missing?

Try this: Duplicate the button that contains the code that sets visible to true. In the new button, change the code to set Visible to False. Remove any other code from that routine. If that works as desired, there is something else afoot in the other code that is trying to set visible to false.

In principle, what you described should not be a problem. I was able to build a test web app (2018r1.1) and get the basic functionality to work.

You may want to invalidate the container after setting it’s visible to false.

Hi Michel. Invalidate?
Don’t seem to have that method.

When I add the button to hide it, it works. However after the control has been used, and the upload event fired the control no longer disappears even with the hide button.

Might this have something to do with the fact that myWebContainer is a subclass of WebContainer?

You know, you should really put questions about web in the Web channel. It would make it a lot easier for other forum readers.

Indeed, webContainer does not have invalidate.

You may try this JavaScript :

self.ExecuteJavaScript( "document.getElementById('"+MyContainer1.ControlID+"').style.visibility='hidden';")

Could you try if adding Webpage1.Show after making WebContainerControl visible works?

It would seem that there was a string that couldn’t be encoded as ASCII.
This was throwing an exception which wasn’t always appearing.