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

Down

How namut such that ............................ Find similar branches


Man In Red   (2001-12-15 20:12) [0]

I have this question:
On the form are RichEdit and Timer. So, in RichEdite, there is a text
and the timer every second one character in the text highlights.

1. How can I make the timer automatically stop when the last character in the text is highlighted?

2. And how to make the carriage move to a new line (If, of course, there is another line, and if not, the timer stops, of course) if the selected character was the last in the line?

I beg you, help, thanks in advance!



KilkennyCat   (2001-12-16 06:56) [1]

Elementary. For standard RichEdit. (Delphi 5 tested)

procedure TForm1.Button1Click (Sender: TObject); // button press
begin
richedit1.SelStart: = 0; // set the carriage to the beginning
richedit1.SetFocus; // subtract the focus from the button
timer1.Enabled: = true // run!
end;

procedure TForm1.Timer1Timer (Sender: TObject);
was
a: longint;
begin
a: = richedit1.SelLength; // store the old value
// increase selection by one character
richedit1.SelLength: = richedit1.SelLength + 1;
// check the end of string abutment
if a = richedit1.SelLength then begin
// trying to switch to another
richedit1.SelLength: = richedit1.SelLength + 2;
// Check to see if the transition is over.
if a = richedit1.SelLength then begin
// rested, however. So, the end of the text. Disable the timer.
timer1.Enabled: = false;
// inform the user, otherwise he will not guess ....
showmessage ("Basta, karapuziki!")
end
end
end;



Man In Red   (2001-12-16 13:29) [2]

NO YOU DID NOT UNDERSTAND!
EACH SECOND ONLY ONE SYMBOL IS ALLOCATED, FIRST FIRST IS ALLENED THEN SECOND, THIRD AND T. D .....................



Pages: 1 whole branch

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

Top









Memory: 0.81 MB
Time: 0.046 c
1-22087
Serg5
2001-12-19 15:14
2002.01.08
People, quite an easy question! Link to the procedure in one word.


1-22096
Mikhalyov Dmitry
2001-12-19 15:55
2002.01.08
About TObject in events


1-22097
Serzhik
2001-12-19 15:45
2002.01.08
What are the two buttons to attach, so that they are at the bottom center?


1-22013
Curious
2001-12-17 12:53
2002.01.08
Run exe from current program.


1-22098
Alexander
2001-12-19 14:58
2002.01.08
Who knows how to pull out the IP editor of the IP address or which component?





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