473,486 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB2005: is mouse CursorPosition still supported?


This statement worked in VB2003, but generates an error for
'CursorPosition' in VB2005. Did not find anything in Help.

mouseX = CursorPosition.X - Me.Location.X

*** Sent via Developersdex http://www.developersdex.com ***
Jan 3 '06 #1
4 1595
"Slindee" <an*******@developerdex.com> schrieb:
This statement worked in VB2003, but generates an error for
'CursorPosition' in VB2005. Did not find anything in Help.

mouseX = CursorPosition.X - Me.Location.X


I believe you wanted to type 'Cursor.Position', which is supported in both
..NET 1.0 and .NET 2.0.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #2

How about this:

Private Sub Form2_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
Dim pt As Point = System.Windows.Forms.Cursor.Position
Dim strScreenPosition As String = pt.ToString
Dim strClientPosition As String =
Me.PointToClient(pt).ToString
Me.Text = "Screen: " & strScreenPosition & ", Client: " &
strClientPosition
End Sub

Works for me.

/Joergen Bech

On Tue, 03 Jan 2006 11:19:30 -0800, Slindee
<an*******@developerdex.com> wrote:

This statement worked in VB2003, but generates an error for
'CursorPosition' in VB2005. Did not find anything in Help.

mouseX = CursorPosition.X - Me.Location.X

*** Sent via Developersdex http://www.developersdex.com ***


Jan 3 '06 #3
Hi,

I usually use mouseposition

http://msdn.microsoft.com/library/de...itiontopic.asp

Ken
-----------------
"Slindee" <an*******@developerdex.com> wrote in message
news:OZ**************@TK2MSFTNGP10.phx.gbl...

This statement worked in VB2003, but generates an error for
'CursorPosition' in VB2005. Did not find anything in Help.

mouseX = CursorPosition.X - Me.Location.X

*** Sent via Developersdex http://www.developersdex.com ***

Jan 4 '06 #4

Control.MousePosition and Cursor.Position do exactly the same thing:
Make a call to GetCursorPos in user32.dll.

But Control.MousePosition is a read-only property, whereas
Cursor.Position is read/write (write using SetCursorPos in user32.dll)
so for consistency I always use Cursor.Position.

Regards,

Joergen Bech

On Wed, 4 Jan 2006 06:57:30 -0500, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

I usually use mouseposition

http://msdn.microsoft.com/library/de...itiontopic.asp

Ken
-----------------
"Slindee" <an*******@developerdex.com> wrote in message
news:OZ**************@TK2MSFTNGP10.phx.gbl...

This statement worked in VB2003, but generates an error for
'CursorPosition' in VB2005. Did not find anything in Help.

mouseX = CursorPosition.X - Me.Location.X

*** Sent via Developersdex http://www.developersdex.com ***


Jan 4 '06 #5

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

Similar topics

9
22710
by: punkin | last post by:
I am trying to catch mouse position on the entire screen by dynamically generating mouse click event at every 100 ms. My code only works for IEs but not any Netscape or Gecko-based browsers. The...
10
18027
by: Danny | last post by:
How can I get the coordinates of the mouse cursor in Mozilla browsers as well as Opera and IE6? I'm struggling to understand how to capture mouse movement events with Mozilla/Netscape/Firefox and...
1
962
by: TheunsP | last post by:
Problem : I want to click the mouse from source code. I move my mouse from source code over another application's display. I now want the mouse to click on the new cursorposition it was moved to...
7
3813
by: guy | last post by:
Has anyone any experience of the conversion wizard for VB6 to VB2005? if so how good is it? also how does it handle database related conversions i.e is ADO converted to ADO.NET etc. the project...
10
1905
by: Galen Somerville | last post by:
Going from VB6 (RAD) to VB2005 (SAD) The documentation always shows graphics drawing in a paint event like Private Sub Pictcolor_Paint(ByVal sender As Object, ByVal e _ As...
1
1650
by: erickwan88 | last post by:
I am doing a final year project for my school and is going to provide for an organization, so I am asking for some help on here. Indeed, I have no idea on how to get the input from my pen driver...
15
1992
by: Aalaan | last post by:
I am presently a user of classic vb6 and hang out on those newsgroups. Some of you may be aware that there is a very anti MS and vb2005 feeling there. I have tried to get them to tell me which...
1
2226
by: Vae07 | last post by:
Ok so here is a brief summary of my problem. I need a pop up form that submits input text box information to a pocket excel workbook upon a command botton click. Text box inputs are checked for...
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.