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.55 MB
Time: 0.021 c
3-21984
Mr. Andrew
2001-12-05 20:39
2002.01.08
Data update


3-21908
Dup
2001-11-28 13:27
2002.01.08
Application hang


7-22421
Shen
2001-08-28 15:05
2002.01.08
Data upload via com port


4-22475
Di_wind
2001-11-02 16:08
2002.01.08
Search


1-22045
Socol
2001-12-15 17:14
2002.01.08
Write to file.





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 Spanish swahili Swedish ภาษาไทย turkish Ukrainian urdu Tiếng Việt 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