Webcontainer

hi!

i create at runtime some rectangles with webcontainer:

With this source:

[code] dim links as integer = 0
dim platz as integer
dim k as integer
dim faktor as integer
dim bbreite as integer
bbreite=960/btage
faktor=160/bmax
for k=1 to btage
platz=platz+1
session.g = new balken
balken(session.g).Rectangle1.ZIndex = platz
balken(session.g).Rectangle1.Height=banzahl(k)*faktor
balken(session.g).Rectangle1.top=160-banzahl(k)*faktor
balken(session.g).Label1.text=mid(bdatum(k),9,2)+"."+mid(bdatum(k),6,2)+"-"+str(banzahl(k))
session.g.EmbedWithin(Rectangle2, links, 0, 83,163)
//session.ggrafik.append session.g
Listbox1.AddRow “”
listbox1.Cell( listbox1.LastIndex, 0 ) = str(k)
listbox1.Cell( listbox1.LastIndex, 1 ) = bdatum(k)
listbox1.Cell( listbox1.LastIndex, 2 ) = str(banzahl(k))

links=links+85

next k
[/code]

The Webcontainer balken has an label1.

With:

balken(session.g).Label1.text=mid(bdatum(k),9,2)+"."+mid(bdatum(k),6,2)+"-"+str(banzahl(k))

i set the text of the labels in the for to next.

But only the first two labels get a text. After that the rest of the labels in the Container has no text, resp. the label does
not apear, if the label has also a standard text.

Strange: if i add another Label to the Webcontainer “balken”, the first third container has this label.

In the other container the label does not appear?

Thanks!

BR
Andreas

Make the label multi line. That seems to work.

Hi Russ!

it is a problem with the order. I put the rectangle to the back in the order and the label to the front.

But after two “balken” ware create, the rectangle comes to the front and the label is behind.

i put the rectangle todally to the back and the label to the frint in the GUI. But it does not work?

And there is nothing to change the order at runtime a thino so?

Thanks!

Andreas

Well it’s a known ‘feature’ that’s been around ages.
I think there may be a patch that fixes it, but I generally just use one of the methods I mentioned.

[quote=183076:@Andreas Arriens]Hi Russ!

it is a problem with the order. I put the rectangle to the back in the order and the label to the front.

But after two “balken” ware create, the rectangle comes to the front and the label is behind.

i put the rectangle todally to the back and the label to the frint in the GUI. But it does not work?

And there is nothing to change the order at runtime a thino so?

Thanks!

Andreas[/quote]

You may want to use a WebCanvas instead of WebRectangle+WebLabel.

Use the same webstyle to make the WebCanvas Green, and draw the text in Paint.

Sub Paint(g as WebGraphics) g.DrawString("My Text", 10, g.height-20) End Sub