Cursor help.

Posted by Chris Nevin on July 29, 2007

Hello All!

I am trying to write a program and have come across a pit fall that I do not know the answer too! Any help would be much appreciated.
Basically I have written something that takes a block of text from an invisible memo and copies it letter for letter into a visible memo, to give the illusion of something being typed out. The problem is that I am trying to make it look like a dos style box, and therefore want a cursor to be flashing at the end of the sentence as it is typed.
The way I have achieved the typing affect so far has involved copying an individual letter to a seperate memo so that I could then use memo2.text:=memo2.text+
so that it added the letter on the end as using pastefromclipboard seems to completely replace the text even if you have set the selstart position to the end of the block of text, which is annoying.
The problem is, that this way of doing things seems to leave the cursor at the beggining of the sentence until it is finished when using memo2.selstart:=(memo2.gettextlength) puts it at the end.
I realise I am probably going about this all a really weird way, however I only have a reasonably limited knowledge of programming so have been using my initiative to make it do what I want!!
Does anyone have any ideas? Would using something like append or something work? Would I be able to append with the text of another memo?

Thanks in advance!

Related articles


Follow Ups