Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: ManagementScope, did it get deprecated or something? Pin
Robert Oujesky18-Apr-18 6:41
Robert Oujesky18-Apr-18 6:41 
GeneralRe: ManagementScope, did it get deprecated or something? Pin
Eddy Vluggen18-Apr-18 7:10
professionalEddy Vluggen18-Apr-18 7:10 
GeneralRe: ManagementScope, did it get deprecated or something? Pin
OriginalGriff18-Apr-18 8:02
mveOriginalGriff18-Apr-18 8:02 
GeneralRe: ManagementScope, did it get deprecated or something? Pin
Robert Oujesky18-Apr-18 8:49
Robert Oujesky18-Apr-18 8:49 
GeneralRe: ManagementScope, did it get deprecated or something? Pin
OriginalGriff18-Apr-18 9:15
mveOriginalGriff18-Apr-18 9:15 
QuestionHow can I add the distance value between the line(from point A to point B) in C#? Pin
Member 1378306217-Apr-18 22:27
Member 1378306217-Apr-18 22:27 
AnswerRe: How can I add the distance value between the line(from point A to point B) in C#? Pin
OriginalGriff17-Apr-18 22:35
mveOriginalGriff17-Apr-18 22:35 
AnswerRe: How can I add the distance value between the line(from point A to point B) in C#? Pin
V.17-Apr-18 23:56
professionalV.17-Apr-18 23:56 
This is from the top of my head so you'll have to work out the details yourself.

Catch the events mousedown and mousemove. If the mouse moves AND mouse button is down you're drawing (or so I assume).
You'll need to find out the coordinates from your canvas where top-left = 0,0 and x moves up to the right and y moves up going down! It might be you need to fiddle with it to get the right coordinates as windows tends to work with multiple sets (your window, your control, the screen, ...)

Once you have the correct coordinates and you start drawing a line (= first point is known) you can calculate the length of your line: sqrt((x2-x1)^2 + (y2-y1)^2) use your mouse location to get the second point.

To set that value on screen, draw a string on the location (x2+x1)/2 and (y2/y1)/2.

This solution should at least get you a bit further, but again, this is on top of my head, you'll need to figure out a lot of it yourself.
V.

AnswerRe: How can I add the distance value between the line(from point A to point B) in C#? Pin
Gerry Schmitz18-Apr-18 6:03
mveGerry Schmitz18-Apr-18 6:03 
Questionhow to deploy your software (set up) Pin
ago248617-Apr-18 6:03
ago248617-Apr-18 6:03 
AnswerRe: how to deploy your software (set up) Pin
Richard MacCutchan17-Apr-18 6:11
mveRichard MacCutchan17-Apr-18 6:11 
GeneralRe: how to deploy your software (set up) Pin
ago248617-Apr-18 6:20
ago248617-Apr-18 6:20 
GeneralRe: how to deploy your software (set up) Pin
ago248617-Apr-18 6:38
ago248617-Apr-18 6:38 
GeneralRe: how to deploy your software (set up) Pin
Richard MacCutchan17-Apr-18 6:41
mveRichard MacCutchan17-Apr-18 6:41 
GeneralRe: how to deploy your software (set up) Pin
ago248617-Apr-18 6:52
ago248617-Apr-18 6:52 
GeneralRe: how to deploy your software (set up) Pin
Richard MacCutchan17-Apr-18 8:45
mveRichard MacCutchan17-Apr-18 8:45 
GeneralRe: how to deploy your software (set up) Pin
ago248617-Apr-18 22:35
ago248617-Apr-18 22:35 
GeneralRe: how to deploy your software (set up) Pin
Richard MacCutchan17-Apr-18 22:38
mveRichard MacCutchan17-Apr-18 22:38 
GeneralRe: how to deploy your software (set up) Pin
ago248617-Apr-18 22:57
ago248617-Apr-18 22:57 
GeneralRe: how to deploy your software (set up) Pin
ago248617-Apr-18 23:48
ago248617-Apr-18 23:48 
GeneralRe: how to deploy your software (set up) Pin
Richard MacCutchan17-Apr-18 23:56
mveRichard MacCutchan17-Apr-18 23:56 
GeneralRe: how to deploy your software (set up) Pin
ago248618-Apr-18 0:00
ago248618-Apr-18 0:00 
GeneralRe: how to deploy your software (set up) Pin
ago248618-Apr-18 0:01
ago248618-Apr-18 0:01 
GeneralRe: how to deploy your software (set up) Pin
Richard MacCutchan18-Apr-18 0:13
mveRichard MacCutchan18-Apr-18 0:13 
GeneralRe: how to deploy your software (set up) Pin
ago248618-Apr-18 0:16
ago248618-Apr-18 0:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.