473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Control.OnClick

I have a form that overrides the OnClick method. The caller sends in an
EventArgs parameter but how can I extract the mouse coordinates from the
EventArgs???? I tried explicit convertion to MouseEventArgs but an
InvalidCastException is thrown.

I know the original OnClick method raises the Click event so it must be able
to somehow extract more information from the EventArg. Does anyone know how
it is achieved?

ben
Nov 16 '05 #1
2 1216
Try using the event OnMouseUp to get the click location. OnClick can be
called when the user uses the KeyBoard and hence it's not always associated
with a mouse click co-ordinates

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

"benben" <be******@yahoo.com.au> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
I have a form that overrides the OnClick method. The caller sends in an
EventArgs parameter but how can I extract the mouse coordinates from the
EventArgs???? I tried explicit convertion to MouseEventArgs but an
InvalidCastException is thrown.

I know the original OnClick method raises the Click event so it must be able to somehow extract more information from the EventArg. Does anyone know how it is achieved?

ben

Nov 16 '05 #2
Thanks! That's exactly what I needed to know!

Try using the event OnMouseUp to get the click location. OnClick can be
called when the user uses the KeyBoard and hence it's not always associated with a mouse click co-ordinates

--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

"benben" <be******@yahoo.com.au> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
I have a form that overrides the OnClick method. The caller sends in an
EventArgs parameter but how can I extract the mouse coordinates from the
EventArgs???? I tried explicit convertion to MouseEventArgs but an
InvalidCastException is thrown.

I know the original OnClick method raises the Click event so it must be

able
to somehow extract more information from the EventArg. Does anyone know

how
it is achieved?

ben


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tom Rowton | last post by:
This one has me a bit confused and I'm not finding what I need in the MSDN or by searching these forums, so here goes... I have a rather large, complex code-in-page WebForm (don't ask) and a...
11
by: trinitypete | last post by:
Hi all, I have a user control that uses control literal to build a heading with a link, and a div containing links below. As the link heading is hit, I want to change the style of the div,...
4
by: Ryan Ternier | last post by:
Hello, I have a repeater control that does the following on the ItemDataBound event. It works perfectly, except that when it prints out, the names of the controls aren't what I'd expect. ...
19
by: Sjaakie Helderhorst | last post by:
Hello, I need to add a Javascript event (onClick) to a servercontrol (asp:checkbox). Checkbox is named 'cbDoMail'. Assumed that 'cbDoMail.Attributes.Add("onClick", "doJavascriptThing()") would do...
1
by: rn5a | last post by:
I have created a custom control button which when clicked displays a message in the JavaScript alert dialog. I could successfully compile the VB class file into a DLL & also could add it to the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.