Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Form Moving

Posted on 2002-05-05
8
Medium Priority
?
187 Views
Last Modified: 2010-04-04
hi
i want a form  to be moved on screen in circular moving
0
Comment
Question by:omeralfaroug
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 8

Accepted Solution

by:
Cesario earned 100 total points
ID: 6990339
add a timer component to your Form

procedure TForm1.Timer1Timer(Sender: TObject);
VAR
 x,y : Integer;
begin
  x := 400+round(200*cos(angle*pi/180));
  y := 200+round(200*sin(angle*pi/180));
  self.left := x;
  self.top := y;
  inc(angle,5);
  if Angle>360 then angle := 0;
end;

good luck

Cesario
0
 

Author Comment

by:omeralfaroug
ID: 6993338
hi Cesario
 i tried it dos't work !!!!!!!!!
just form move just one a time to corner then stoped
i want it to move always  on screen in circular
0
 
LVL 8

Expert Comment

by:Cesario
ID: 6993346
Hi Faroug,

it works fine ;-)

But just add this Field to the public part of your form:

Type
  TForm1 = Class ( ...
  Public
     Angle : Integer;
     .....
  End;

Best Regards

Cesario
 
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:omeralfaroug
ID: 6993470
hi Cesario
 i tried it dos't work !!!!!!!!!
just form move just one a time to corner then stoped
i want it to move always  on screen in circular
0
 

Expert Comment

by:W_Fox
ID: 6993613
omeralfaroug - check your code. I tried it on D5-it works juuuuust fine :)
actually, if you are using Cesario's code, it's impossible to have form moved to the corner and then _stopped_, because there's no code for timer stopping => form will be moved endlessly (ok, until you close it) and it'll be outside of screen area. So, "Problem's at your side!" [remembering old programmer joke, if interested I can post it fully. offtopic, of course]

W_Fox
0
 

Author Comment

by:omeralfaroug
ID: 6995717
hi W fox
all u say is right {(=> form will be moved endlessly (ok, until you close it) and it'll be outside of screen area)}
 also i think ur words is realy like ur Name :)
thanks for help
regards...
omer alfaroug
0
 
LVL 8

Expert Comment

by:Cesario
ID: 6995797
Hello omer,

you can change the Parameters:

 x := 200+round(200*cos(angle*pi/180));
 y := 100+round(200*sin(angle*pi/180));

have a nice day ;-)

Cesario
0
 

Author Comment

by:omeralfaroug
ID: 6996040
Thanks  Cesario

i change parameters Beforeu say  that and now it works
thanks for ur help and good luck with my points :-)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question