Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / April 2004

Tip: Looking for answers? Try searching our database.

Page hit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ruca - 06 Apr 2004 16:00 GMT
How can I get the coordinates of where I click with the mouse?
It is possible to know?

Signature

Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Raymond Lewallen - 06 Apr 2004 16:07 GMT
Ruca,

Look at System.Drawing.Point
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdrawingpointclasstopic.asp

And

Control.PointToScreen method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformscontrolclasspointtoscreentopic.asp

HTH,

Raymond Lewallen

> How can I get the coordinates of where I click with the mouse?
> It is possible to know?
[quoted text clipped - 4 lines]
> Hope this help you (if I try to help you)
> ruca
Raymond Lewallen - 06 Apr 2004 16:27 GMT
Ruca,

Wasn't paying attention :)  I don't believe the Drawing namespace of
Control.PointToScreen method will work for you in a web based solution..
only in windows forms solutions.

Sorry for trying to confuse you :)

Raymond Lewallen

> Ruca,
>
> Look at System.Drawing.Point

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> frlrfsystemdrawingpointclasstopic.asp
>
> And
>
> Control.PointToScreen method

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> frlrfsystemwindowsformscontrolclasspointtoscreentopic.asp
>
[quoted text clipped - 10 lines]
> > Hope this help you (if I try to help you)
> > ruca
CJ Taylor - 06 Apr 2004 16:10 GMT
you can handle it in the event such as click or doubleclick (depending on if
its availiable).

you can hittest.

you can use the API.

> How can I get the coordinates of where I click with the mouse?
> It is possible to know?
Cor - 06 Apr 2004 16:15 GMT
Hi Ruca,

Are you using fixed webpages.

I do not believe that this is standard possible with HTML pages. Maybe you
can use the area map for this or something.

(I type this more to show the others you are using ASPX)

:-)

Cor
bruce barker - 06 Apr 2004 18:46 GMT
try these routines, they are pretty accurate:

function findPosY(obj){
 var curtop = 0;
 if (document.getElementById || document.all) {
  while (obj.offsetParent) {
   curtop += obj.offsetTop;
   if (typeof(obj.scrollTop)  == 'number')
    curtop -= obj.scrollTop;
   obj = obj.offsetParent;
  }
 }
 else if (document.layers)
  curtop += obj.y;
 return curtop;
}

function findPosX(obj) {
 var curleft = 0;
 if (document.getElementById || document.all) {
  while (obj.offsetParent) {
   curleft += obj.offsetLeft
   obj = obj.offsetParent;
  }
 }
 else if (document.layers)
  curleft += obj.x;
 return curleft;
}

-- bruce (sqlwork.com)

> How can I get the coordinates of where I click with the mouse?
> It is possible to know?
[quoted text clipped - 4 lines]
> Hope this help you (if I try to help you)
> ruca
ruca - 08 Apr 2004 11:45 GMT
Where should I call them?

Signature

Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca.

> try these routines, they are pretty accurate:
>
[quoted text clipped - 36 lines]
> > Hope this help you (if I try to help you)
> > ruca
bruce barker - 09 Apr 2004 04:31 GMT
in client code. if you the x & y on the server, then you want to use an
image map

-- bruce (sqlwork.com)

> Where should I call them?
>
[quoted text clipped - 44 lines]
> > > Hope this help you (if I try to help you)
> > > ruca
Lithium - 09 Apr 2004 13:01 GMT
This easy solution is for internet explorer - PS Mozilla suck

<html onclick="get_Coords();"><body
for internet explore
set in the html tag an onclick event
<p>dsjkafdskfda</p><script language="JScript"
function get_Coords(
 
 alert ("relative to Client Area Origin: \r\n"
          event.clientX+"\r\n"
          event.clientY
          "\r\n relative to Screen Area Origin: \r\n"
          event.screenX+"\r\n"
          event.screenY)
 
</script></body></html

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.