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 7088233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:46:29+00:00 2026-05-28T07:46:29+00:00

Strange behavior with C# (VS 2010) ListView Control mouse click event (items are without

  • 0

Strange behavior with C# (VS 2010) ListView Control mouse click event (items are without checkbox):

private void m_ListView_MouseClick(object sender, MouseEventArgs e)
{
    if (e.Button == System.Windows.Forms.MouseButtons.Left)
    {
        // Returning some times wrong values
        ListViewItem lvi = m_ListView.GetItemAt(e.X, e.Y); 

        //.... more logic here
    }
}

After I clicked the item, and immediately I moved the mouse down or up, some other item is getting selected instead of what is intended;

I debugged and came to know that e.X, e.Y is capturing WRONG values. When I click and leave the mouse pointer unmoved, it’s working fine. But if I clicked and immediately moved to another row, one of that row is getting selected instead.

Questions:

  • Is this a known issue with ListView mouse events?
  • Is there any other way to retrieve correct coordinates for the mouse events?

This is an enterprise level project, where performance is very important. We have written original code for all mouse events like up, down, doubleclick, mouseclick, itemcheck etc.

-Karthik

  • 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-28T07:46:30+00:00Added an answer on May 28, 2026 at 7:46 am
    ListViewItem lvi = m_ListView.FocusedItem;
    

    That should work to get the item that was just clicked (Focused)

    m_ListView.GetItemAt(e.X, e.Y);
    

    Would get the item at the mouse location, which is why it changes when you move the mouse quickly away, if you want the item that you just clicked, m_ListView.FocusedItem should work fine

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

Sidebar

Related Questions

I came across strange behavior in Visual Studio 2010 C++ compiler. Following code compiles
Using OneNote 2010 doing some C# interop stuff. Observing some very strange behavior, which
I found strange behavior in QTP 11 today: expression Browser().Page().WebElement(PositionManagerContainer).WebElement(LoadingMessage).Object.ParentNode.ParentNode Gives error: Object Required
I'm getting this strange behavior when I launch a program without selecting Step Into
I noticed a strange behavior regarding keydown event in Chrome. I have this simple
a strange behavior happens when install the application and then run the exe file.
I've experienced rather strange behavior of JSTL forEach tag. I have some bean called
I have encountered a strange behavior while executing an sql query on the Oracle
I have a very strange behavior with Request.Form . Here are two IIS 7
I'm witnessing some strange behavior with SharePoint when changing user's Active Directory passwords. I

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.