Help me!
I am trying to pass a video between forms.
i created 2 forms and i added button1,button2, listbox1, openfiledialog1 in first form and then i added just a media player in second form. I press button1 and select video then press button2 and the video opens in form2 but i can't do this :( :(
This is Form1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace lord
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void button1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
OpenFileDialog filedialog = new OpenFileDialog();
if (filedialog.ShowDialog() == DialogResult.OK)
{
FileInfo dosyabilgisi = new FileInfo(filedialog.FileName);
listBox1.Items.Add("" + dosyabilgisi.Name);
}
}
public void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
axWindowsMediaPlayer1.URL = openFileDialog1.FileName;
}
public void Form1_Load(object sender, EventArgs e)
{
axWindowsMediaPlayer1.settings.autoStart = false;
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.play();
}
}
}
And this is form2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace lord
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
}
}
}
Form2 is empty :) Show me the way out.