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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:45:27+00:00 2026-06-04T17:45:27+00:00

I just want to know how can i drag and drop a line which

  • 0

I just want to know how can i drag and drop a line which was created dynamically at runtime (mouse draw line) in c# . The dynamic line was placed over a panel.

  • 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-06-04T17:45:29+00:00Added an answer on June 4, 2026 at 5:45 pm

    I have used two ways in the past:

    1. On MouseDown calculate the distance between the line and the mouse cursor. If it is within a couple of pixels start dragging. While the MouseButton is down respond to the MouseMove by translating the startpoint and the endpoint of the line over the same vector (current mouse position – start dragging mouse position)

    2. On MouseDown test the color of the pixel under the mouse cursor to see if it is over the line. If so do the same dragging as above.

    The tricky thing is that option 1 is hard when there are multiple lines that are close and you need to find out which line needs to be dragged

    Option 2 is hard when the line is very thin.

    Another way is to draw a thicker line on an invisible bitmap when a line is drawn and test the pixel on the invisible bitmap. That way you can give a bit more tolerance AND you could give each invisible line a color that is distinct so it is easier to identify what line has been clicked.

    Does this make sense?

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

Sidebar

Related Questions

I just want to know that can i make an application which have some
I just want to know: How can I delete 'log.txt' if the last modification
I just want to know if I can see several videos at once from
I just want to know if there is a program that can convert an
I just want to know why both the paint and draw methods are used
I just want to know how can I add the data type here? Google
Hi Folks i just want to know how can i make a or a
if you please I just want to know how can I replay to sms
Just want to know if publishing an application on Google play is allowed using
Just want to know how to read an attribute of a parent node from

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.