WebContainer.EmbedWithin

From Xojo Documentation

Method

WebContainer.EmbedWithin(View as WebView, left as Integer, top as Integer, width as Integer, height as Integer)

Supported for all project types and targets.

Embeds the WebView in the current page without drawing the window frame, title bar, title bar widgets, grow handle, and so forth. Use this set of parameters with webpages whose LayoutType is Fixed.


Method

WebContainer.EmbedWithin(View as WebView, width as Integer, height as Integer)

Supported for all project types and targets.

Embeds the WebView in the current page without drawing the window frame, title bar, title bar widgets, grow handle, and so forth. Use this set of parameters with webpages whose LayoutType is Flex.

Notes

The Left and Top parameters determine the location of the top-left corner, relative to the containing page. The parameters Width and Height determine the size of the embedded view.

You can use EmbedWithin in to dynamically add controls to a page. Add the control (or controls) you want to add to a WebContainer and then use EmbedWithin to add the container to the page at run-time.

The locking properties of the WebContainer are not carried over when you use EmbedWithin. Instead, set these values accordingly before calling EmbedWithin. For example:

Var c As New MyContainer
c.LockLeft = True
c.LockTop = True
c.LockRight = True
c.EmbedWithin(Self, 0, 0, c.Width, c.Height)

Example

This code adds a WebContainer, called LoginContainer, to a web page at run-time:

Var login As New LoginContainer
login.LockLeft = True
login.LockTop = True
login.EmbedWithin(Self, 0, 0, login.Width, login.Height)