I added .dll: AxWMPLib
and using method get_Ctlcontrols()
but it show error like:
AxWMPLib.AxWindowsMediaPlayer.Ctlcontrols.
It looks like you are trying to access a property by calling explicitly its get method.
Try this (notice that get_
and ()
are missing):
this.Media.Ctlcontrols.stop();
Here is a small example about how properties work in C# - just to make you understand, this does not pretend to be accurate, so please read something more serious than this :)
using System;
class Example {
int somePropertyValue;
// this is a property: these are actually two methods, but from your
// code you must access this like it was a variable
public int SomeProperty {
get { return somePropertyValue; }
set { somePropertyValue = value; }
}
}
class Program {
static void Main(string[] args) {
Example e = new Example();
// you access properties like this:
e.SomeProperty = 3; // this calls the set method
Console.WriteLine(e.SomeProperty); // this calls the get method
// you cannot access properties by calling directly the
// generated get_ and set_ methods like you were doing:
e.set_SomeProperty(3);
Console.WriteLine(e.get_SomeProperty());
}
}