Solved

Form Moving

Posted on 2002-05-05
8
179 Views
Last Modified: 2010-04-04
hi
i want a form  to be moved on screen in circular moving
0
Comment
Question by:omeralfaroug
  • 4
  • 3
8 Comments
 
LVL 8

Accepted Solution

by:
Cesario earned 50 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
 

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now