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.56 MB
Time: 0.029 c
7-22441
ulysses
2001-09-19 20:31
2002.01.08
Delphi 5 Ent is not installed normally under Win2k Pro


7-22419
Pastor
2001-09-21 10:31
2002.01.08
Do I have a Celeron 800 worth upgrading to the Pentium III 800?


1-22149
Roman_zdrj
2001-12-20 12:43
2002.01.08
calls from dll


3-21960
Alenka
2001-12-05 12:53
2002.01.08
Help me please!


1-22181
Diet
2001-12-21 11:12
2002.01.08
How to prohibit mouse form movement?





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