Not a solution, but I am now opening the webcam as an external program from my main form.
Basically I published and installed the webcam program and call it using a button with the following code:
Private Sub cbActivateCamera_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
System.Diagnostics.Process.Start("C:\ ---enter program destination to its exe file-- ")
End Sub
The following code closes the external program using the Close button:
Private Sub cbCloseCamera_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName(" --program name--- ")
For Each p As Process In pProcess
p.Kill()
Next
End Sub
Again this is not a solution to my problem rather a temporary fix so i'm still open to all suggestions or ideas.
Thanks,
James.