I have this sub on form1:
Public Sub PlayMaskVideo(filePath As String)
If File.Exists(filePath) Then
If MaterialTabControl2.SelectedIndex = 0 Then Mask0Img.Visible = False
If libVLC Is Nothing Then
Core.Initialize()
libVLC = New LibVLC()
End If
mediaPlayer = New MediaPlayer(libVLC)
Mask0VLC.MediaPlayer = mediaPlayer
media = New Media(libVLC, filePath, FromType.FromPath)
media.AddOption("input-repeat=65535")
mediaPlayer.Volume = 0
mediaPlayer.Play(media)
End If
End Sub
This code works as expected if called on Form1, it plays a video in the vlcsharp player on the form.
What I'm trying to do is call it from form2 like this:
Form1.PlayMaskVideo(outputPreview)
I'm expecting the video to play in the form1 video player however nothing happens. I thought maybe its an issue with vlcsharp, but even this line doesn't execute:
If MaterialTabControl2.SelectedIndex = 0 Then Mask0Img.Visible = False
Am I missing something?
Here's an example of how I accomplished the issue I was having. Instead of using form1.something = value I used an eventhandler. Like this:
Then on Form 2:
So when you enter a value on Form2 and click Submit, the value in the textbox will be sent to the Form1 label.