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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:02:59+00:00 2026-05-30T11:02:59+00:00

I am working on a custom control which draws curves on it and allows

  • 0

I am working on a custom control which draws curves on it and allows user to change the properties of the curve by clicking on it. Now capturing the events on the curves itself is very difficult as they might be very thin (as per the user requirement)

Somehow I want to increase the hit selection are for the curves.
I have a solution for it but it is really expensive as I have huge number of curves in my chart. Thatz why I am searching for a logic by which I can find limited curves around mouse pointer.

I tried HitTest() but it does not help.
I googled a lot for the solution but no gain.

If somebody can spotsome light on this topic and suggest me a correct direction to proceed then that will be a great help.

Thanks in advance.

  • 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-30T11:03:04+00:00Added an answer on May 30, 2026 at 11:03 am

    You’ll have to implement this functionality yourself. What you could do is listen to MouseEnter/MouseLeave of the underlying line and if you get a mousedown within a certain radius of the initial MouseEnter/Leave count this as a hit.

    For instance, in pseudo code:

    OnMouseEnter()
    {
        this.hittestPoint = currentMousePoint;
    }
    
    OnMouseLeave()
    {
        this.hitTestPoint = currentMousePoint;
    }
    
    OnMouseDown()
    {
        // Looking for mousedown within a 5 pixel radius of the line. 
        // Increase/decrease according to experimentation
        const double radius = 5;
    
        // Note see Euclidean distance for distance between vectors
        // http://en.wikipedia.org/wiki/Euclidean_distance
        double deltaX = (hitTestPoint.X - currentPoint.X);
        double deltaY = (hitTestPoint.Y - currentPoint.Y);
        double distance = Math.Sqrt(deltaX*deltaX + deltaY*deltaY);
    
        if(distance < radius) 
        {
             // Hittest detected!
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a CMS which allows you to develop your own custom controls
I'm working on a custom user control that essentially displays a name value pair
I'm working on Expression Blend and I'm currently designing a custom control which has
I have one sharepoint custom page application which is rendering from a user control.
I have a Windows form which hosts a custom User Control. This User Control
I have made one custom user control (search text box), which basically consists of
I'm working on creating a date/time user control in WPF using C# 2008. My
I'm working on custom control that I can use for interactions within my app
I'm currently designing a custom tab control class which derives from System.Windows.Forms.Control. The problem
I'm working with an already built ASP.Net custom date control, it seems pretty simple,

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.