473,320 Members | 1,933 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,320 software developers and data experts.

<control>.locationChanged ??

KS
How can I find out how much the location chanced ?

How does the arguments Sender or e show me that ?

KS, Denmark
Jul 21 '05 #1
5 1525
Cor
Hi KS,
Have a look at this,

Not as a direct answer on your question, but as a sample to help you to
understand the movement of the cursor and how to catch that.

Cor

\\\
Private Sub myControl_MouseDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseDown
swMousedown = True
MyFunction.Mousedown(myControl.PointToScreen(New Point(0, 0)))
End Sub
Private Sub myControl_MouseUp(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseUp
swMousedown = False
End Sub
Private Sub myControl_MouseMove(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseMove
Static LastCursor As Point
Dim NowCursor As Point = New Point(Cursor.Position.X, Cursor.Position.Y)
If Point.op_Inequality(NowCursor, LastCursor) and swMousedown Then
'doSomething
End If
LastCursor = Cursor.Position
End Sub
///
Jul 21 '05 #2
KS
Thanks for your answer but shall I then conclude that
the arguments Sender/e NOT can tell me how much
the location changed ?

There are many ways to calculate the movements but I
and I would expect that Sender/e could tell me that.

KS, Denmark

"Cor" <no*@non.com> skrev i en meddelelse
news:ex**************@TK2MSFTNGP09.phx.gbl...
Hi KS,
Have a look at this,

Not as a direct answer on your question, but as a sample to help you to
understand the movement of the cursor and how to catch that.

Cor

\\\
Private Sub myControl_MouseDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseDown swMousedown = True
MyFunction.Mousedown(myControl.PointToScreen(New Point(0, 0)))
End Sub
Private Sub myControl_MouseUp(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseUp
swMousedown = False
End Sub
Private Sub myControl_MouseMove(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles myControl.MouseMove Static LastCursor As Point
Dim NowCursor As Point = New Point(Cursor.Position.X, Cursor.Position.Y)
If Point.op_Inequality(NowCursor, LastCursor) and swMousedown Then 'doSomething
End If
LastCursor = Cursor.Position
End Sub
///

Jul 21 '05 #3
Cor
KS,

To give you a direct answer to your second question
The sender is the object that send the event in your example probably
your button and than is something as
me.button1.location the same as
directcast(sender,button).location

The e is the event and for that you have to look at the event argument of
the event.

I hope this helps,

Cor
How can I find out how much the location chanced ?

How does the arguments Sender or e show me that ?

Jul 21 '05 #4
Cor
Hi KS,
See my other message I did made it in almost the same time, but I did
forget to push the button to send I saw so it is delayed.
Cor
Jul 21 '05 #5
KS
YES - that's what I needed - thanks !

KS, Denmark

"Cor" <no*@non.com> skrev i en meddelelse
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi KS,
See my other message I did made it in almost the same time, but I did
forget to push the button to send I saw so it is delayed.
Cor

Jul 21 '05 #6

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

Similar topics

4
by: Matthew Louden | last post by:
It happend to me more than once. When I create web controls or move the positions in VS.NET, I encountered the following run-time errors: It doesn't matter what controls I create, the following...
3
by: Hadar | last post by:
Hi, I'm trying to dynamically set the src of an iframe with the <% %> block: <iframe id="content" src="<% = Request.QueryString.Get("content") %>" width="100%"></iframe> Notice that the tag...
3
by: Marlon | last post by:
Which one of the methods would use less server resources and give better performance to display data on a page?
5
by: KS | last post by:
How can I find out how much the location chanced ? How does the arguments Sender or e show me that ? KS, Denmark
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
1
by: MarkShoe | last post by:
Hi, I have an aspx with a control on it, lets call it myControl, and I have an external javascript file. In the external javascript file, I have var myControlId = '<%=myControl.ClientID%>';...
7
by: Ned White | last post by:
Is it possible to insert HTML codes to a textbox control ? I am reading HTML formated string from sql server but if i assign this value to Text property of TextBox, the format tags of HTML seems...
1
by: avecreep | last post by:
Hi, i was trying to find a web application and i found one open source on the internet. i put the code folders on the root folder and when i tried to acces via web browser it all worked fine ( i...
3
by: AleXmanFree | last post by:
Hi , I have got problem with passing my inline based value to y user control (or custom control, no matter which one I use, I have tried both to make sure it doesnt matter) . So say I have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.