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.
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?
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’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.
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)
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.