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

C#

 
AnswerRe: Another tcp / net question.. Pin
Eddy Vluggen21-May-13 3:02
professionalEddy Vluggen21-May-13 3:02 
QuestionGenerics in C# Pin
srikumarrampa20-May-13 23:37
srikumarrampa20-May-13 23:37 
AnswerRe: Generics in C# Pin
Abhinav S21-May-13 1:08
Abhinav S21-May-13 1:08 
GeneralRe: Generics in C# Pin
srikumarrampa21-May-13 18:04
srikumarrampa21-May-13 18:04 
AnswerRe: Generics in C# Pin
Alan N22-May-13 4:21
Alan N22-May-13 4:21 
GeneralRe: Generics in C# Pin
srikumarrampa22-May-13 19:37
srikumarrampa22-May-13 19:37 
AnswerRe: Generics in C# Pin
BillWoodruff23-May-13 2:23
professionalBillWoodruff23-May-13 2:23 
QuestionPassing Cursor Coordinates as Parameters Pin
ASPnoob20-May-13 21:52
ASPnoob20-May-13 21:52 
Hi All,
I am trying to create a function that passes the cursor's starting and ending x,y coordinates as parameters. For instance I would like to set the cursor's starting x,y coordinate when the user clicks the left mouse button. Then as the user holds down the left mouse button and drags the cursor to a desired location, the ending x,y coordinate is dynamically set and updated. The final ending coordinate is set when the left button is released. I am currently working with the following code:

C#
 private void Cursor_Coord(out Cursor C1, out Cursor C2)
{
   // Set the Current cursor, move the cursor's Position,      
   Cursor C1;
   Cursor C2;
   
   if(Mouse.LeftButton == MouseButtonState.Pressed)
   {
     C1 = new Cursor(Cursor.Current.Handle);
     C1.Position = new Point(Cursor.Position.X,  Cursor.Position.Y);
   }

   if(Mouse.LeftButton == MouseButtonState.Released)
   {
     C2 = new Cursor(Cursor.Current.Handle);
     C2.Position = new Point(Cursor.Position.X, Cursor.Position.Y);
   }
}


I am planning to send the changing cursor coordinates to the Drawline method to be used as the first and second point. The effect I have in mind is that the line is drawn as the mouse is in motion. The problem is it's not working. Any help will be greatly appreciated, thanks in advance.

modified 21-May-13 4:02am.

AnswerRe: Passing Cursor Coordinates as Parameters Pin
Pete O'Hanlon20-May-13 22:01
mvePete O'Hanlon20-May-13 22:01 
GeneralRe: Passing Cursor Coordinates as Parameters Pin
ASPnoob20-May-13 22:05
ASPnoob20-May-13 22:05 
AnswerRe: Passing Cursor Coordinates as Parameters Pin
OriginalGriff20-May-13 22:52
mveOriginalGriff20-May-13 22:52 
GeneralRe: Passing Cursor Coordinates as Parameters Pin
ASPnoob21-May-13 16:38
ASPnoob21-May-13 16:38 
GeneralRe: Passing Cursor Coordinates as Parameters Pin
lukeer21-May-13 21:47
lukeer21-May-13 21:47 
GeneralRe: Passing Cursor Coordinates as Parameters Pin
OriginalGriff21-May-13 22:21
mveOriginalGriff21-May-13 22:21 
QuestionPropertyGrid Multiple Objects Selection Pin
vvino202020-May-13 20:48
professionalvvino202020-May-13 20:48 
AnswerRe: PropertyGrid Multiple Objects Selection Pin
Eddy Vluggen20-May-13 22:32
professionalEddy Vluggen20-May-13 22:32 
AnswerRe: PropertyGrid Multiple Objects Selection Pin
Simon_Whale20-May-13 22:52
Simon_Whale20-May-13 22:52 
AnswerRe: PropertyGrid Multiple Objects Selection Pin
lukeer21-May-13 21:58
lukeer21-May-13 21:58 
QuestionNot able to use Modern UI Charts for Windows 8 Pin
Raghavendra Reddy C20-May-13 18:40
professionalRaghavendra Reddy C20-May-13 18:40 
AnswerRe: Not able to use Modern UI Charts for Windows 8 Pin
Abhinav S20-May-13 18:49
Abhinav S20-May-13 18:49 
GeneralRe: Not able to use Modern UI Charts for Windows 8 Pin
Raghavendra Reddy C20-May-13 20:30
professionalRaghavendra Reddy C20-May-13 20:30 
AnswerRe: Not able to use Modern UI Charts for Windows 8 Pin
Pete O'Hanlon20-May-13 21:40
mvePete O'Hanlon20-May-13 21:40 
GeneralRe: Not able to use Modern UI Charts for Windows 8 Pin
Raghavendra Reddy C20-May-13 22:35
professionalRaghavendra Reddy C20-May-13 22:35 
GeneralRe: Not able to use Modern UI Charts for Windows 8 Pin
Pete O'Hanlon20-May-13 22:54
mvePete O'Hanlon20-May-13 22:54 
AnswerRe: Not able to use Modern UI Charts for Windows 8 Pin
Raghavendra Reddy C20-May-13 22:53
professionalRaghavendra Reddy C20-May-13 22:53 

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.