Canvas over an HTMLViewer issue

Hi,
I have an HTMLViewer in my window, and I also placed a canvas above the HTMLViewer (I also set the canvas to be on top via the IDE button which moves controls up to the very top of the z-order).

Depending on a buttons state - either:

HTMLViewer1.visible = False Canvas1.Visible = True

Or

HTMLViewer1.visible = True Canvas1.Visible = False

However, whenever the HTMLViewer.visible=False, the canvas also disappears???

Is this because I dragged my canvas over the top of the HTMLViewer in the window, and now the canvas is somehow part of the HTMLViewer - resulting in it becoming invisible when the HTMLViewer is invisible?

If I put the HTMLViewer just on the left side of the window, and the canvas on the right side of the window - this works as expected.
It is only when I place the canvas on top of the HTMLViewer in the window, that this fails.

Thank you all in advance.

HtmlViewer never was playing nice with other controls. If the canvas is a child of the HtmlViewer then you can try to set

canvas1.parent = nil

in the open event. What are you trying to do?

I simply have a “Welcome” canvas which hides / covers the HTMLViewer until a page is loaded.
Then the canvas SHOULD get hidden, resulting in the HTMLViewer’s content becoming visible.

I will try that line of code you just posted.

Thanks.

UPDATE
Beatrix, your line of code seems to have worked!

Thank You.

You could consider a PagePanel.

Panel 0 has the Canvas and Panel 1 has the HTMLViewer.

Simon.

Also a good idea.
I will bear that in mind for future reference.

Thanks.

Or…

  1. Set HTMLView.visible=false
  2. set Canvas.visible=true
  3. when HTML load completed. switch the visiblity flags

Now I have plenty of options :slight_smile:
Thanks Dave.

OR…

  1. Set htmlView content to “Hello There”
  2. load the URL
  3. it will replace the view in #1 when complete

no canvas required.

That’s also a neat way of doing it.
Thanks.