Off Screen Canvas Transparency Issues

I have a small canvas that I move off screen on window.open and I move it to a location on the window for a function and then move it back off screen when that function is complete. I want the canvas to be semi-transparent but it loses it’s transparency to show the controls underneath when it’s position originates off the window. I have tried everything from refreshing the canvas manually with a button click (just to test that) and windows declares to change the window/control order. The only way I can achieve a transparent canvas is to place the canvas on the window using the IDE with it set to not visible and then show/hide the canvas in place instead. Any advice on what is causing this?

Behavior may be different on Windows vs. macOS, so please move the question to the appropriate sub forum, or at least state which OS you’re using. A few weeks ago Xojo posted a video from their last conference where William explains how the transparency has changed lately on Windows - maybe that’s affecting you.

Also: http://www.angryflower.com/itsits.gif :wink:

[quote=494707:@Thomas Tempelmann]Behavior may be different on Windows vs. macOS, so please move the question to the appropriate sub forum, or at least state which OS you’re using.

Also: http://www.angryflower.com/itsits.gif ;)[/quote]

Fair point. I’m on Windows but I would prefer to keep the question where it is.

have you tried self.invalidate for the whole window after moving your canvas?

I had tried refreshing the main window before, I just tried to invalidate the main window after moving the canvas in place but it’s still not transparent. There is a canvas on the main window and this little canvas moves in and out on top of that one. I have tried a lot of combinations of those things.

i can test tomorrow

seems this transparent canvas need the canvas background as parent. in the ide it would show a red border.
its ok if the transparent canvas is inside (and clipped) of the background canvas?

as transparent paint i use this

[code]Sub Paint(g As Graphics, areas() As REALbasic.Rect) Handles Paint
g.Transparency = 50
g.DrawingColor = Color.Red
g.FillRectangle 0,0,g.Width,g.Height

End Sub
[/code]

the in and our moving just use .Left = xxx at button click

[quote=494764:@Markus Rauch]seems this transparent canvas need the canvas background as parent. in the ide it would show a red border.
its ok if the transparent canvas is inside (and clipped) of the background canvas?

as transparent paint i use this

[code]Sub Paint(g As Graphics, areas() As REALbasic.Rect) Handles Paint
g.Transparency = 50
g.DrawingColor = Color.Red
g.FillRectangle 0,0,g.Width,g.Height

End Sub
[/code]

the in and our moving just use .Left = xxx at button click[/quote]

I tried changing the parent of the control using declares I assumed that was the issue but it didn’t work. I have the canvas off screen at run time and just to make sure it’s not visible on window.open I am assigning the the starting position of the small canvas using

Canvas1.Left = Screen(0).Width*2

As far as I know the only way to assign the parent using the IDE is to drag the small canvas on to the larger one that is contained within the window. This does indeed work and I have transparency. What I wanted to do was start the smaller canvas positioned off screen and then assign the parent when I move it on top of the other canvas. This doesn’t work even when I use a windows declare to assign the parent and invalidate the window.

[quote=494844:@Geoff Haynes][/quote]
off screen means not visible, so Canvas1.Left = -Canvas1.Width would hide it and Canvas1.Left = xxx show it

stop using api with declares just drop this smaller one in the middle of the canvas background

or do you will moving the small canvas from outer canvas background on to any place in the window?

i not get your problem.

[quote=494855:@Markus Rauch]off screen means not visible, so Canvas1.Left = -Canvas1.Width would hide it and Canvas1.Left = xxx show it

stop using api with declares just drop this smaller one in the middle of the canvas background

or do you will moving the small canvas from outer canvas background on to any place in the window?[/quote]

I appreciate your help but I don’t think you understand what I am trying to accomplish. I know how to position controls and I realize, as I stated in my last post, that I know it will work if I use the IDE to assign the parent to the smaller canvas. Thanks again.

yes i not get your problem.
i guess you will move this transparent canvas free in the whole window?

If I understand things correctly you want to re-parent the smaller canvas on the bigger one (you do not need to use declares to achieve this):
SmallCanvas.Parent = BigCanvas
SmallCanvas.Left = BigCanvas.Left + x
SmallCanvas.Top = BigCanvas.Top + y

[quote=494873:@William Yu]If I understand things correctly you want to re-parent the smaller canvas on the bigger one (you do not need to use declares to achieve this):
SmallCanvas.Parent = BigCanvas
SmallCanvas.Left = BigCanvas.Left + x
SmallCanvas.Top = BigCanvas.Top + y[/quote]

Strange setting the parent with declares didn’t work but setting the parent this way does. Maybe I wasn’t getting the correct handle back for the control? Anyway, setting the control parent this way does the trick. Thanks.