Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.04.01;
Download: [xml.tar.bz2];

Down

Caption form Find similar branches


Romik   (2002-03-21 20:10) [0]

Hello Masters!
Please tell me how to make the caption form animated,
Ie create effect movement text.

Thank you in advance.



Юрий Зотов   (2002-03-21 20:39) [1]

For example, the source text is stored in a string, the current beginning is in an integer variable, and Caption is formed on a timer based on this data.



Romik   (2002-03-21 20:41) [2]

> Yuri Zotov © (21.03.02 20: 39)

Is it possible in more detail - I'm a novice programmer.



Юрий Зотов   (2002-03-21 21:27) [3]

Here is a possible option, if something does not suit - modify it.

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, StdCtrls;

type
TForm1 = class (TForm)
Timer1: TTimer;
Edit1: TEdit;
Button1: TButton;
procedure Timer1Timer (Sender: TObject);
procedure Button1Click (Sender: TObject);
private
FPos: integer;
FCaption: string;
public
procedure SetNewCaption (const Value: string);
end;

was
Form1: TForm1;

implementation

{$ R * .DFM}

procedure TForm1.SetNewCaption (const Value: string);
begin
if FCaption <> Value then
begin
Timer1.Enabled: = False;
FCaption: = Value;
FPos: = 0;
Caption: = FCaption;
Timer1.Enabled: = True
end
end;

procedure TForm1.Timer1Timer (Sender: TObject);
was
L: integer;
S: string;
begin
Timer1.Enabled: = False;
try
L: = Length (FCaption);
If FPos = L then FPos: = 0;
Inc (FPos);
S: = Copy (FCaption, FPos, L - FPos + 1);
if FPos> 1 then S: = S + "" + Copy (FCaption, 1, FPos - 1);
Caption: = S
finally
Timer1.Enabled: = True
end
end;

procedure TForm1.Button1Click (Sender: TObject);
begin
SetNewCaption (Edit1.Text)
end;

end.



Romik   (2002-03-21 22:44) [4]

> Yuri Zotov © (21.03.02 21: 27)
Thank you very much!!! Something like I expected.



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.04.01;
Download: [xml.tar.bz2];

Top









Memory: 0.56 MB
Time: 0.018 c
We answer immediately.
Flagman
2002-03-20 12:43
2002.04.01
Tbasearray


We answer immediately.
Sandro
2002-01-12 00:24
2002.04.01
How to transmit sound in real time through sockets


We answer immediately.
boogier
2002-03-07 14:33
2002.04.01
How to avoid errors when executing SQL query


We answer immediately.
Draculenok
2002-03-01 15:15
2002.04.01
How to group in Excele &


We answer immediately.
solsoft
2002-03-06 13:43
2002.04.01
No access to Access via BDE





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish