Click here to Skip to main content
15,892,643 members

Comments by tvviewer (Top 1 by date)

tvviewer 10-Feb-12 12:38pm View    
Hi, i would like to programmatically add one or more vlc players to a windows form at runtime
I first dragged a vlc ocx over and then reproduced this code which the designer had made:

AxVLCPlugin2 axVLCPlugin21;
public Form1()
{
InitializeComponent();

System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.axVLCPlugin21 = new AxAXVLC.AxVLCPlugin2();

((System.ComponentModel.ISupportInitialize)(this.axVLCPlugin21)).BeginInit();
this.SuspendLayout();

this.axVLCPlugin21.Enabled = true;
this.axVLCPlugin21.Location = new System.Drawing.Point(70, 30);
this.axVLCPlugin21.Name = "axVLCPlugin21";
this.axVLCPlugin21.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axVLCPlugin21.OcxState")));
this.axVLCPlugin21.Size = new System.Drawing.Size(400, 400);
this.axVLCPlugin21.TabIndex = 3;

this.Controls.Add(this.axVLCPlugin21);
((System.ComponentModel.ISupportInitialize)(this.axVLCPlugin21)).EndInit();
this.ResumeLayout(false);

axVLCPlugin21.AutoPlay = true;
axVLCPlugin21.Width = 400;
axVLCPlugin21.Height = 400;

axVLCPlugin21.playlist.add(@"C:\file.mp4");
axVLCPlugin21.playlist.playItem(0);
}

but it does not work. Any help here?