I have moved to a new PC and from VS 2019 Community to VS 2022 Community. I have a treeview control in my program and double-click a node to run a video, spawning the default video player. This all works and the video plays fine. When the video completes the user closes the default video player and what happened in VS 2019 is the myProcess_Exited is fired to update an xml file to remember the video has been played.
This is the treeview code and it all works, what isn't happening is myProcess_Exited is never entered. I have tried removing and re-clicking the exited event with no luck. I have set enableraisingevents at design time no change. have i unintentionally deleted something that is required to get this routine to fire. I did find one similar question but it was coded in C which I don't have any experience of.
Private Sub TreeView1_NodeMouseDoubleClick(sender As Object, e As TreeNodeMouseClickEventArgs) Handles TreeView1.NodeMouseDoubleClick
' to start the video file we need the full path in the file system.
' Play the video with the default app for this filetype.
myProcess.StartInfo.FileName = TreeView1.SelectedNode.FullPath
MyProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
myProcess.EnableRaisingEvents = True
' Play the video and wait for the user to stop it.
myProcess.Start()
End Sub