Hiding the MoviePlayer to display something in it's place until needed

I’ve designed a window with the movieplayer control where I want it. I would like it to be invisible and show something else in its place until I want to start the video. I’ve tried setting the visible property to false and that doesn’t seem to do it.

Is this a bug or am I doing something wrong?

Have you tried a pagepanel? Some controls like to be in front.

You could also try just moving it off the window by setting the Left property to the window’s width.

I did consider something like this but I wanted to see what others have been seeing.

I have not tried that. I can understand if some controls like to be in front, but in my book, not visible means not visible. If I can’t hide the control with the visible or other property, what use is it?

1 Like

This really seems like a bug or at least documentation issue. While I don’t mind doing a work around, which is pretty simple, I think this is something that should be possible like most other controls that we don’t want to see at some point by doing ControlName.visible=false.

I guess I’ll submit a bug report.

Create an Issue about this.

Set as visible false using the IDE the control is visible, changing the visible by using the button the control changes to visible false.

ezgif.com-gif-maker (23)

As a workaround, set the control with the IDE as Visible = True and in the Opening event put

me.Visible = False

I’ve already submitted an issue about this. I did try using a button at runtime to change it to false on the visible property, that didn’t do anything.I can see from your post it does seem to be working. I’d be interested to see if you can display something else in that player’s location when it’s not visible.

Like this?

ezgif.com-gif-maker (24)

Case #71392

I added sample code and workaround.


Edit:

I can replicate that if MoviePlayer1 is set to False in the IDE. Having code in a button that set False to MoviePlayer1 doesn’t work. Needs to change the Visible to True then False to work. (That’s why the workaround set MoviePlayer1 to Visible True, then False in Opening)

1 Like

I will try that.

I got it working as expected, but found that if I try to add a label on top of the movieplayer control, it seems like it’s acting like a containing preventing it to be displayed before the movieplayer is visible. To fix this, I create label, then create or move the movieplayer back over the lable and it seems to work just fine. Anyway, my issue is solved.

Like many other controls in Xojo, if you put a control on top of another one (fully contained), it becomes a child of the other control (when you select the child control, the parent control has a red rectangle around it).
In such cases, the visibility of the parent affects the child (as does the enabled property).

Another way to deal with this is to put this in the opening event (of one control, or the window):
TheLabelAboveTheCanvas.Parent=nil
Which defeats the relation between the two controls.

Thanks!