Search code examples
vb6media-playerolevisible

How to hide the object of the OLE controler?


I'm working with the OLE object using VB6. I use it to play a sound when a certain condition is true. The OLE class is MPlayer. The problem is that I don't want the player to be visible. I know that I can set the Visible property of the OLE control to false, but thats just hides the conrtrol itself, but not the MPlayer itself. I've tried the following:

    If Something Then
        ' Starts the music.
        OLEPlayer.Action = 7
        ' Here, which line I should use to hide the MPlayer itself?
        ' OLEPlayer.Visible = False - hides just the controler, and not its class.
        ' There is no Visible property to the Class.
    Else
        ' Stops the music.
        oleAlarmSound.Action = 9
    End If

I've looked everywhere, but since there is a minor support for VB6 in general, and VB6 ole in particular, i've found nothing.


Solution

  • Use

    Screen.Width
    Screen.Height
    object.Top
    object.Left
    

    to move the object out of the screen area