Refresh a container control?

I was drawing my control in the shown event, but I want to ‘redraw’ it.
Is there an event I must raise to get the control to refresh?

Have you tried to use invalidate on your control?

[quote=194779:@Brian O’Brien]I was drawing my control in the shown event, but I want to ‘redraw’ it.
Is there an event I must raise to get the control to refresh?[/quote]

WebContainer does not have Refresh or Invalidate. But under normal circumstances it redraws itself automatically. For instance if I change the style in a button, it takes effect right away.

What is it you need redrawn ? The WebContainer itself or a control inside ?

I embedded a bunch of controls in the ‘shown’ event. That worked.
However I’ve changed the structure of the code and now I’m Embedding them after the shown event and nothing is appearing.

I’m wondering if maybe my view should have sub classed from ContainerControl rather than WebContainer.

show us couple of your code!

Hi Brian,
I don’t know if this can help you but remember that you can only embed webcontainers…

There’s a bug in your code. In general WebContainer.EmbedWithin works at any time after Shown has fired, and the ‘redraw’ is automatic. (It’s not a redraw really, but a DOM change on the client browser.)

ContainerControl is the desktop version of WebContainer. It cannot be used in a web project.

I found the issue in my code.

As for the container control why is it in the library in the ide when the project in the ide is a web project?

[quote=195107:@Brian O’Brien]I found the issue in my code.

As for the container control why is it in the library in the ide when the project in the ide is a web project?[/quote]

What is called Container Control in the Library is in fact a WebContainer. Just like an Image Well is in fact a WebImageView. I guess Xojo tried to make the library as close as possible to the desktop one to make things easier for people unfamiliar with Web.

If you drag it to the project, look at its super : WebContainer.

So again I’m not sure I grasp the difference in intention of the WebControl vs the WebContainer.
Right now my top level inherits from WebControl and uses embedwithin to Embed other WebControls in it that make up my view.
Why might I need the WebContainer?

Hi Brian,

you must create a WebContainer with the required WebControl(s) in it, then you can embed the Webcontainer in your WebView (WebPage or other WebContainer).

Does that explain the difference?
i.e. the WebContainer can only be used in the ide?

The only element type that you can embed dinamically (i.e. at runtime) in a WebView it is a WebContainer.
So you must prepare at design time the WebContainer(s) that you plan to embed at runtime in your WebViews.

There are two demo projects related to this topic in the examples installed with the IDE in “Example Projects\Web\Containers”.

ContainerControlExample it is for a statically container embedded at design time.
ContainerControlDynamicExample it is for a container embedded at runtime.