Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6045201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:05:55+00:00 2026-05-23T07:05:55+00:00

Working with C# in Visual Studio 2008 (.NET 3.5). Looking into System.Windows.Forms.MouseEventArgs . I’m

  • 0

Working with C# in Visual Studio 2008 (.NET 3.5). Looking into System.Windows.Forms.MouseEventArgs.

I’m seeing strange behavior with long Panel when I intercept handle the MouseMove event. It appears that MouseEventArgs.X goes from 0 to 32767, and wraps around to -32768.

When I watch the variable in Visual Studio, it claims that it’s of type int.

Apparently it’s a 16-bit signed integer the way it’s behaving. Is this true? Is this a hard limit?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:05:55+00:00Added an answer on May 23, 2026 at 7:05 am

    This probably comes from the fact that Windows Forms is basically a .NET wrapper around the C Windows API. For the WM_MOUSEMOVE and related messages (WM_LBUTTONDOWN, etc.), the mouse coordinates are sent in the LPARAM parameter. LPARAM is a typedef for LONG_PTR, which on 32-bit Windows (only) is in turn a typedef for long. As the docs for WM_MOUSEMOVE say, you can get the cursor position by using the GET_X_LPARAM and GET_Y_LPARAM macros, which return the low-order int and the high-order int, respectively.

    Since the value is 32 bits to start with (on 32-bit Windows), the only way this makes sense is for the x and y coordinates to actually be 16-bit values. Based on the definition of GET_X_LPARAM in windowsx.h, I would also guess (but do not have an official source that says) that even on x64 only the lower 32 bits of the LPARAM are used for the mouse coordinates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working in .NET Compact Framework, C#, .Net 3.5, Visual Studio 2008. Targeting Windows Mobile
I'm using Visual Studio 2008, .net Framework 3.5 for a Windows forms client-server app
I am working in Visual Studio 2008 on an ASP.NET application, which has been
I'm trying to get edit-and-continue working with Visual Studio 2008 with an ASP.Net MVC
When working with an ASP.NET application in Visual Studio 2008, my errors window often
When working in a VB.NET project in Visual Studio (2008 specifically, but hopefully the
ASP.net C# 3.5 Framework, working in Visual Studio 2008 currently. What I want is
Using Visual Studio 2008 and VB.Net: I have a working web app that uses
I am working on a CMS project using ASP.Net 3.5/Visual studio 2008.This is the
I'm using visual studio 2008 SP1, I'm working with a web project in VB.NET.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.