Click here to Skip to main content
15,890,527 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need a Script? Pin
Guffa4-Mar-07 9:58
Guffa4-Mar-07 9:58 
GeneralRe: Need a Script? Pin
Abubakarsb4-Mar-07 11:23
Abubakarsb4-Mar-07 11:23 
GeneralRe: Need a Script? Pin
sharpiesharpie4-Mar-07 11:25
sharpiesharpie4-Mar-07 11:25 
GeneralRe: Need a Script? Pin
Guffa4-Mar-07 12:01
Guffa4-Mar-07 12:01 
GeneralRe: Need a Script? Pin
Abubakarsb4-Mar-07 21:25
Abubakarsb4-Mar-07 21:25 
AnswerRe: Need a Script? Pin
Guffa4-Mar-07 22:18
Guffa4-Mar-07 22:18 
GeneralRe: Need a Script? Pin
Abubakarsb4-Mar-07 23:01
Abubakarsb4-Mar-07 23:01 
QuestionMoving a control along a line... [modified] Pin
new_phoenix4-Mar-07 8:51
new_phoenix4-Mar-07 8:51 
As an example, say that you have a control that is positioned on a form at its starting place, and you drag that control to another location on a form at its ending place, that would form a line. If conditions were not appropriate for the placement of that control, it would be a good idea to move that control back to its starting place on the form. However, I would like to show the position of that control at several points as it is moved back to the starting place on the form, or even better to show its placement as a continuous motion.

As near as I could figure it, I worked it out mathematically to place the control at several locations along the line back to its starting point. I would find the half way point, and then from the half way point, I would find the quarter way point and three-quarter way point, and so on. In this way, I could plot 64 points along the line to show its new location on the way back to the starting point.

The question is, is there any way of plotting the place along the line utilizing the equivalent of a spline line? That is, the code currently looks like this:

private static void ProvideDragPathReturnToParent(Control ctrl, int intX_end, int intY_end, int intX_start, int intY_start)
{
     Point pt0 = new Point(intX_start, intY_start);
     Point pt64 = new Point(intX_end, intY_end);
     Point pt32 = new Point(((pt0.X + pt64.X)/2) ((pt0.Y + pt64.Y));
     Point pt16 = new Point(((pt0.X + pt32.X)/2) ((pt0.Y + pt32.Y));
     Point pt48 = new Point(((pt32.X + pt64.X)/2) ((pt32.Y + pt64.Y));
     ... etc, etc, etc ...

     Point[] arrPoint = {pt64, pt63, pt62, pt61...pt0};  // puts them in the right order

     foreach (Point pt in arrPoint)
     {
        ctrl.Location = pt;
        ctrl.Update();
     }
 }


but I would like the code to resemble something like this:

for each System.Drawing.Point on System.Drawing.Line
{
     ctrl.Location = new System.Drawing.Point(e.X, e.Y);
     ctrl.Update();
}


Please provide some insights as to how to plot points along a line dynamically or moving the control along the spline along every point rather than along selected points. Does such an approch exist?

Confused | :confused: Confused | :confused: Confused | :confused:





-- modified at 17:04 Sunday 4th March, 2007
AnswerRe: Moving a control along a line... Pin
S. Senthil Kumar4-Mar-07 15:03
S. Senthil Kumar4-Mar-07 15:03 
Questionc# / COM / Excel Automation Add-Ins Pin
Member 38866844-Mar-07 7:07
Member 38866844-Mar-07 7:07 
QuestionStringConverter - Editing an existing value instead of creating one Pin
andy1804-Mar-07 5:18
andy1804-Mar-07 5:18 
AnswerRe: StringConverter - Editing an existing value instead of creating one Pin
Guffa4-Mar-07 10:00
Guffa4-Mar-07 10:00 
QuestionController/GUI in seperate asemblies Pin
MEK34-Mar-07 4:38
MEK34-Mar-07 4:38 
AnswerRe: Controller/GUI in seperate asemblies Pin
S. Senthil Kumar4-Mar-07 7:11
S. Senthil Kumar4-Mar-07 7:11 
QuestionIE Toolbar with visual studio 2005 Pin
ga2144-Mar-07 4:25
ga2144-Mar-07 4:25 
AnswerRe: IE Toolbar with visual studio 2005 Pin
Vasudevan Deepak Kumar4-Mar-07 5:04
Vasudevan Deepak Kumar4-Mar-07 5:04 
GeneralRe: IE Toolbar with visual studio 2005 Pin
Wayne Phipps4-Mar-07 6:25
Wayne Phipps4-Mar-07 6:25 
GeneralRe: IE Toolbar with visual studio 2005 Pin
Vasudevan Deepak Kumar4-Mar-07 15:33
Vasudevan Deepak Kumar4-Mar-07 15:33 
QuestionScanning through directories and subdirectories Pin
Polezniy4-Mar-07 1:01
Polezniy4-Mar-07 1:01 
AnswerRe: Scanning through directories and subdirectories Pin
kubben4-Mar-07 2:00
kubben4-Mar-07 2:00 
GeneralRe: Scanning through directories and subdirectories Pin
Polezniy4-Mar-07 9:50
Polezniy4-Mar-07 9:50 
GeneralRe: Scanning through directories and subdirectories Pin
Wayne Phipps4-Mar-07 10:26
Wayne Phipps4-Mar-07 10:26 
GeneralRe: Scanning through directories and subdirectories Pin
kubben4-Mar-07 11:11
kubben4-Mar-07 11:11 
GeneralRe: Scanning through directories and subdirectories Pin
Polezniy5-Mar-07 5:24
Polezniy5-Mar-07 5:24 
GeneralRe: Scanning through directories and subdirectories Pin
kubben5-Mar-07 5:29
kubben5-Mar-07 5:29 

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.