Click here to Skip to main content
15,891,567 members
Home / Discussions / C#
   

C#

 
QuestionHow to make a border less form draggable inside specified location in .net? Pin
srikrishnathanthri17-Aug-16 1:34
srikrishnathanthri17-Aug-16 1:34 
AnswerRe: How to make a border less form draggable inside specified location in .net? Pin
BillWoodruff17-Aug-16 3:03
professionalBillWoodruff17-Aug-16 3:03 
GeneralRe: How to make a border less form draggable inside specified location in .net? Pin
srikrishnathanthri17-Aug-16 19:09
srikrishnathanthri17-Aug-16 19:09 
GeneralRe: How to make a border less form draggable inside specified location in .net? Pin
BillWoodruff17-Aug-16 21:41
professionalBillWoodruff17-Aug-16 21:41 
Generalhow to create user rights for different forms c# Pin
Member 308047017-Aug-16 1:14
Member 308047017-Aug-16 1:14 
GeneralRe: how to create user rights for different forms c# Pin
Aless Alessio17-Aug-16 1:35
Aless Alessio17-Aug-16 1:35 
GeneralRe: how to create user rights for different forms c# Pin
Richard MacCutchan17-Aug-16 2:01
mveRichard MacCutchan17-Aug-16 2:01 
QuestionC# and MS SQL DeadLock Pin
Zeyad Jalil16-Aug-16 23:41
professionalZeyad Jalil16-Aug-16 23:41 
AnswerRe: C# and MS SQL DeadLock Pin
Pete O'Hanlon17-Aug-16 0:15
mvePete O'Hanlon17-Aug-16 0:15 
AnswerRe: C# and MS SQL DeadLock Pin
Gerry Schmitz17-Aug-16 6:09
mveGerry Schmitz17-Aug-16 6:09 
AnswerRe: C# and MS SQL DeadLock Pin
Andrea Simonassi16-Sep-16 3:46
Andrea Simonassi16-Sep-16 3:46 
Questionhow to copy controls of one flowlayoutpanel to other? Pin
Le@rner16-Aug-16 20:30
Le@rner16-Aug-16 20:30 
AnswerRe: how to copy controls of one flowlayoutpanel to other? Pin
Richard MacCutchan16-Aug-16 21:22
mveRichard MacCutchan16-Aug-16 21:22 
GeneralRe: how to copy controls of one flowlayoutpanel to other? Pin
Le@rner16-Aug-16 22:30
Le@rner16-Aug-16 22:30 
GeneralRe: how to copy controls of one flowlayoutpanel to other? Pin
OriginalGriff16-Aug-16 22:55
mveOriginalGriff16-Aug-16 22:55 
GeneralRe: how to copy controls of one flowlayoutpanel to other? Pin
Le@rner18-Aug-16 19:02
Le@rner18-Aug-16 19:02 
QuestionC# GDI+ simulation of inclined plane Pin
Member 1268837716-Aug-16 5:59
Member 1268837716-Aug-16 5:59 
AnswerRe: C# GDI+ simulation of inclined plane Pin
OriginalGriff16-Aug-16 6:14
mveOriginalGriff16-Aug-16 6:14 
GeneralRe: C# GDI+ simulation of inclined plane Pin
Member 1268837716-Aug-16 6:29
Member 1268837716-Aug-16 6:29 
GeneralRe: C# GDI+ simulation of inclined plane Pin
OriginalGriff16-Aug-16 6:33
mveOriginalGriff16-Aug-16 6:33 
GeneralRe: C# GDI+ simulation of inclined plane Pin
Member 1268837716-Aug-16 7:05
Member 1268837716-Aug-16 7:05 
GeneralRe: C# GDI+ simulation of inclined plane Pin
OriginalGriff16-Aug-16 8:00
mveOriginalGriff16-Aug-16 8:00 
GeneralRe: C# GDI+ simulation of inclined plane Pin
Member 1268837716-Aug-16 8:10
Member 1268837716-Aug-16 8:10 
GeneralRe: C# GDI+ simulation of inclined plane Pin
Member 1268837716-Aug-16 8:18
Member 1268837716-Aug-16 8:18 
GeneralRe: C# GDI+ simulation of inclined plane Pin
OriginalGriff16-Aug-16 8:35
mveOriginalGriff16-Aug-16 8:35 
We ask questions because all we get to work with is what you type - we don't get any context beyond that to work from.

So start by ignoring the object and use a "placeholder" - a circle or dot is fine - and get that working first.

Write a method to draw a plane, and a dot on the plane corresponding to a time you pass as the parameter, along with the Graphics object to draw onto (you get given this in the Paint event handler arguments).
The Plane is easy, a 45 degree incline is just:
C#
g.DrawLine(Pens.Black, 0, 0, 0, 200);
g.DrawLine(Pens.Black, 0, 200, 200, 200);
g.DrawLine(Pens.Black, 200, 200, 0, 0);

And drawing a dot is trivial:
C#
g.DrawEllipse(Pens.Red, x - 1, y - 1, 3, 3);
Add a Panel to your form, handle the
Paint event, and call the method, passing it the number of seconds since the movement started.
All you have to do then is call Invalidate on the Panel in the Tick event of your timer after workign out the time since the start.

Does that make sense?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

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.