In Visual Studio (tested with VB.NET and C#), you can set it with the object property window.
As you can see in my first post, I creating control manually, not by designer.
Nevertheless I checked how designer sets this property. I had to use git, because this property is not set in *.Designer.cs. It turns out that it is set as binary value in resources. I don't know what that is (part of resx file):
Code: Select all
<data name="ocxState" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAgwEAAAIB
AAAAAQAAAAAAAAAAAAAAAG4BAAAHAAAAKABDAG8AdQBuAHQAKQADAA0AAAAIAAAAQQB1AHQAbwBMAG8A
bwBwAAsAAAAIAAAAQQB1AHQAbwBQAGwAYQB5AAsA//8JAAAAQgBhAGMAawBDAG8AbABvAHIAAwAAAAAA
BwAAAEIAYQBzAGUAVQBSAEwACAAAAAAACAAAAEIAcgBhAG4AZABpAG4AZwALAAAADAAAAEUAeAB0AGUA
bgB0AEgAZQBpAGcAaAB0AAMANSUAAAsAAABFAHgAdABlAG4AdABXAGkAZAB0AGgAAwCqQgAAEQAAAEYA
dQBsAGwAcwBjAHIAZQBlAG4ARQBuAGEAYgBsAGUAZAALAAAAAwAAAE0AUgBMAAgAAAAAAAkAAABTAHQA
YQByAHQAVABpAG0AZQADAAAAAAAHAAAAVABvAG8AbABiAGEAcgALAAAABwAAAFYAaQBzAGkAYgBsAGUA
CwD//wYAAABWAG8AbAB1AG0AZQADADIAAAAL
</value>
</data>
Here is example how to manually create control:
Code: Select all
_axVlcPlugin2 = new AxVLCPlugin2();
_axVlcPlugin2.BeginInit();
tableLayoutPanel1.Controls.Add(_axVlcPlugin2, 0, 1);
_axVlcPlugin2.Dock = DockStyle.Fill;
_axVlcPlugin2.Enabled = true;
_axVlcPlugin2.Location = new Point(3, 38);
_axVlcPlugin2.Name = "axVLCPlugin2";
_axVlcPlugin2.OcxState = (AxHost.State) VlcResources.ocxState;
_axVlcPlugin2.Size = new Size(645, 360);
_axVlcPlugin2.TabIndex = 0;
_axVlcPlugin2.MediaPlayerPlaying += OnPlaying;
_axVlcPlugin2.MediaPlayerEncounteredError += OnError;
_axVlcPlugin2.MediaPlayerEndReached += OnEndReached;
_axVlcPlugin2.EndInit();
Now it works.