dynamic imbedded control

HI Masters!

I had multiple webcontainer.
I add it dynamically on a single webform.
My question Sir are:

  1. Is it possible to determine if a certain webcontainer is already imbedded?
  2. I yes, How I can make the previous imbedded webcontrol to become on top?

Please share your learning to a novice like me. Thanks!

Use a module property such as :

mywebContainers() as myWebContainer

Then when you embed a new WebContainer, do this

Dim CC as new myWebContainer myWebContainers.append(CC) CC.Embedwithin(self, 0, 0, CC.width, CC.Height

That way all your containers are tucked in the myWebContainers() array.

To locate them more easily, you may add a property to the WebContainer, for instance Title as string which you initialize after Dimming, and can find back in the array.

For i as integer = 0 to myWebContainers.ubound if myWebContainer(i).Title = "Arnold" then //Do whatver you need exit end if next

To arrange controls front and back, use their zIndex property.

So its possible!

I’m so glad that you answer my inquiry Master. I’ll try that!

[quote=279920:@ronaldo florendo]So its possible!

I’m so glad that you answer my inquiry Master. I’ll try that![/quote]

Ronaldo you’re welcome, but please call me Michel. We are all fellow programmers, and we all began at one point or another.

Hi Michel,

I’m sorry for calling you all as Masters.

Im just submissive from expert people because I want to learn. I been in Xojo for almost 1 year and August is my first year anniversary.
Despite of purchasing different xojo 3rd party tools, still I dont have the luck to deploy any system from it. Maybe because I can’t get the solutions from the forum very well.

Ok, Michel, thank you so much!

Congratulations for your first year. Keep coming back, it works :slight_smile:

Hi Michel,

Im trying to figure out your suggestion but its seems that I can’t make it work.
Here is the scenario.
#1. I have two(2) different Web Container that is NOT YET pasted on webform.
#2. I want to dynamically imbbed each Web Container it to webform (overlap each other) by just clicking a button.

Maybe you can refer me ready made sample so that It serve for me as a guide.
You help is very much appreciated.

Well, that should not be such an issue. Just follow the example above :

Use a module property such as :

mywebContainers() as myWebContainer

Then when you embed a new WebContainer, do this

Dim CC as new myWebContainer myWebContainers.append(CC) CC.Embedwithin(self, 0, 0, CC.width, CC.Height)

It is up to you to set left and top so the containers overlap.

Thanks Michel!

I think I made it work now.