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

C#

 
GeneralRe: "this" keyword Pin
Ron Beyer11-Sep-13 17:35
professionalRon Beyer11-Sep-13 17:35 
GeneralRe: "this" keyword Pin
N8tiv11-Sep-13 18:08
N8tiv11-Sep-13 18:08 
GeneralRe: "this" keyword Pin
Ron Beyer11-Sep-13 18:15
professionalRon Beyer11-Sep-13 18:15 
GeneralRe: "this" keyword Pin
N8tiv11-Sep-13 18:26
N8tiv11-Sep-13 18:26 
GeneralRe: "this" keyword Pin
Ron Beyer11-Sep-13 18:50
professionalRon Beyer11-Sep-13 18:50 
GeneralRe: "this" keyword Pin
Abhinav S11-Sep-13 18:23
Abhinav S11-Sep-13 18:23 
GeneralRe: "this" keyword Pin
V.11-Sep-13 21:49
professionalV.11-Sep-13 21:49 
QuestionDrawing a line that follows a moving point Pin
Davebandit11-Sep-13 4:40
Davebandit11-Sep-13 4:40 
Hello, I'm very new to C# programming, in fact I only started about 3 months ago and have no formal training, only on the job. I have the need to draw a line on a windows form, that follows a moving point. there are actually 2 points I need to follow creating 2 separate lines. below is the code that creates the moving points:

private void timer1_Tick(object sender, EventArgs e)
       {
           Double X1, Y1, A, B;
           int x2, y2, c, d;

           X1 = 300 + (708 * (30 - simNumber14.OldValue) / 30);
           Y1 = 495 - (354 * simNumber6.OldValue / 31.5);

           x2 = (int)X1;
           y2 = (int)Y1;

           tietrack.Location = new Point(x2, y2);

           A = 297 + (711 * (30 - simNumber14.OldValue) / 30);

           B = 704 - (158 * (Math.Max((simNumber3.OldValue - 19.49), 0))/ 15);

           c = (int)A;
           d = (int)B;

           tietrack2.Location = new Point(c, d);
       }


A timer variable (simNumber14.OldValue) counts down from 30 minutes to 0, and the points move back to their origins and start to track again. At which point the lines they created over the first 30 minutes would be gone and new ones would start. the process would repeat itself as long as it was asked to. I can't imagine it would be that hard, but I'm very new to this.

Thanks
AnswerRe: Drawing a line that follows a moving point Pin
Richard MacCutchan11-Sep-13 6:22
mveRichard MacCutchan11-Sep-13 6:22 
GeneralRe: Drawing a line that follows a moving point Pin
Davebandit11-Sep-13 8:28
Davebandit11-Sep-13 8:28 
GeneralRe: Drawing a line that follows a moving point Pin
Eddy Vluggen11-Sep-13 11:09
professionalEddy Vluggen11-Sep-13 11:09 
GeneralRe: Drawing a line that follows a moving point Pin
Davebandit12-Sep-13 1:04
Davebandit12-Sep-13 1:04 
GeneralRe: Drawing a line that follows a moving point Pin
Richard MacCutchan11-Sep-13 20:53
mveRichard MacCutchan11-Sep-13 20:53 
Questionnested classes Pin
Member 1026649411-Sep-13 1:51
Member 1026649411-Sep-13 1:51 
AnswerRe: nested classes Pin
Member 1026649411-Sep-13 2:00
Member 1026649411-Sep-13 2:00 
GeneralRe: nested classes Pin
Keith Barrow11-Sep-13 2:17
professionalKeith Barrow11-Sep-13 2:17 
GeneralRe: nested classes Pin
Member 1026649411-Sep-13 3:13
Member 1026649411-Sep-13 3:13 
GeneralRe: nested classes Pin
Dave Kreskowiak11-Sep-13 4:54
mveDave Kreskowiak11-Sep-13 4:54 
GeneralRe: nested classes Pin
NotPolitcallyCorrect11-Sep-13 2:41
NotPolitcallyCorrect11-Sep-13 2:41 
AnswerRe: nested classes Pin
V.11-Sep-13 3:20
professionalV.11-Sep-13 3:20 
AnswerRe: nested classes Pin
Richard MacCutchan11-Sep-13 6:19
mveRichard MacCutchan11-Sep-13 6:19 
QuestionHow can I solve thiss error : "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" Pin
babak1411-Sep-13 1:33
babak1411-Sep-13 1:33 
AnswerRe: How can I solve thiss error : "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" Pin
OriginalGriff11-Sep-13 2:31
mveOriginalGriff11-Sep-13 2:31 
AnswerRe: How can I solve thiss error : "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" Pin
Keith Barrow11-Sep-13 2:40
professionalKeith Barrow11-Sep-13 2:40 
GeneralRe: How can I solve thiss error : "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" Pin
babak1411-Sep-13 5:27
babak1411-Sep-13 5:27 

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.