[RESOLVED] Extracting date from EventArgs
I am trying to write a graphics program in which I use a Panel on a Windows form as the graphics surface. I have a click event routine which is triggered whn the user clicks on the Panel. I want to extract the X and Y coordinates from EventArgs which is passed to the routine. I can see the values in the 'e' argument if I set a break point to examine whn the break point occurs but do not know how to extact thes values, Can anyone please help.?
Re: Extracting date from EventArgs
Posting a sample of your code would help. I'm hard pressed to understand what you mean by "Extracting the values" - if you can see them when debugging, they should be available just like any other property.
Re: Extracting date from EventArgs
Thanks for reply foamy. Here is the piece of code where I want to obtain the X and Y values of the point clicked but the compile will no allow e.X and e.Y. :-
private void panel1_Click(object sender, EventArgs e)
{
int horizPos,vertPos;
horizPos = e.X
vertPos = e.Y;
switch (nLines)
Re: Extracting date from EventArgs
Well, the generic EventArgs does not contain any such properties.
I think you should handle the MouseClick event rather than the Click event..
Re: Extracting date from EventArgs
Many Thanks 'Foamy'I have just made the change you suggest and that works fine now.