0
Answer

to save coordinates in datagridview

Rudra Jha

Rudra Jha

10y
664
1
I have a Project in which i have to find coordinate of running video. i did that, but the second thing is that, I have to save the coordinate in data grid view as soon as user clicks to get the coordinates in video. i'm having problem in it . i'm using visual studio 2010... please help me some one . here is the code what i did.....
 
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog openfileialog1 = new OpenFileDialog();
if (openfileialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.textBox_Path.Text = openfileialog1.FileName;
}
}
private void button1_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.URL = textBox_Path.Text;
axWindowsMediaPlayer1.Ctlcontrols.play();
}
private void button3_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.stop();
}
private void button4_Click(object sender, EventArgs e)
{
axWindowsMediaPlayer1.Ctlcontrols.pause() ;
}
int x = 0, y = 0;
protected override void OnMouseClick(MouseEventArgs e)
{
base.OnMouseClick(e);
Pen P = new Pen(Color.DarkSeaGreen);
Pen erase = new Pen(Color.White);
x = e.X; y = e.Y;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void label2_Click(object sender, EventArgs e)
{
}
private void axWindowsMediaPlayer1_ClickEvent(object sender, AxWMPLib._WMPOCXEvents_ClickEvent e)
{
int x = 0, y = 0;
Pen P = new Pen(Color.DarkSeaGreen);
Pen erase = new Pen(Color.White);
x = e.fX; y = e.fY;
label1.Location = new Point(x - label1.Width, y);
label2.Location = new Point(x, y - label2.Height);
label1.Text = x.ToString();
label2.Text = y.ToString();
}
please help me some one...