Hi there…
I have a main webpage that I want to load different containers when I click on items on the toolbar.
A. I can’t seem to see where in the toolbar events, clicking on them will fire the code for embedding
B. I’ve checked out selfembed… how do I close a container off the window so I can load a new container?
It’ll be full steam ahead after I know this (Container rock - I’ll be going back to my desktop add and adding containers!)
Cheers,
Sean
The Action event of the buttons seems like the best place to embed.
Use WebPage properties for your containers. I tend to use arrays of WebContainers, so I can do such thing as :
Dim C as new Container1
ContainersArray.Append C
C.Embedwithin(Self, 0,0,300,300)
That way I have a reference to the embedded containers, and I can do
ContainersArray(ContainersArray.Ubound-1).Close
That’s cool for the webcontainers…easily adaptable!
I worked out that you need buttons not menu items on the toolbar
Why is this a syntax error?
ProfileContainer.EmbedWithin(Self, 0, 0, ProfileContainer.Width, ProfileContainer.Height)
Here’ the code in my buttonaction
Select Case Item.Name
Case "Button1"
MapContainer.Close
ProfileContainer.EmbedWithin(Self, 0, 0,1000,700)
Case "Button2"
ProfileContainer.Close
MapContainer.Embedwithin(Self, 0,0,300,300)
End Select
for
ProfileContainer.EmbedWithin(Self, 0, 0,1000,700) and MapContainer.Embedwithin(Self, 0,0,300,300)
and the close commands I get
I get static reference to instance method: call this on an instance of class Webcontainer
I copied it pretty much from the LR… The toolbar is on my mainpage and when I click on the toolbar buttons I want the last webcontainer to close and the new one appear on the page.
Help?
You need to make a new instance of ProfileContainer…like this…
Dim pc as new ProfileContainer
pc.EmbedWithin(self,0,0,1000,300)
The problem is that I can’t close the webcontainers.
I can get them to embed but when I press another button, that webcontainer just overlays the last one.
Is there a good method to remove every webcontainer off a page? If I do that at the start of the buttonaction, then that would work.
Select Case Item.Name
Case "Button1"
''''dim mc as MapContainer
''''mc.Close
Dim pc as new ProfileContainer
pc.EmbedWithin(self,0,Mainpage.Toolbar1.Height+10,pc.width,pc.height)
Case "Button2"
'''''ProfileContainer.Close
Dim mc as new MapContainer
mc.Embedwithin(Self, 0,Mainpage.Toolbar1.Height+10,mc.width,mc.height)
End Select
[quote=240464:@Sean Clancy]The problem is that I can’t close the webcontainers.
I can get them to embed but when I press another button, that webcontainer just overlays the last one.
[/quote]
Read again my post above about using an array to keep a reference about each container you add, so you can close it afterward. That is how you do it.