ermac
asked on
A few questions about TMemo
I have a few questions to ask regarding the TMemo component
1) Is there a way to open large files (>100kb)?
2) How can I get the position of the cursor (i.e. row and col)?
3) Unlike the TRichEdit component, TMemo component does not have the OnSelectionChange event. I need to display the position of the cursor whenever the cursor is moved. How can I do this?
Thanks in Advance
Ermac
1) Is there a way to open large files (>100kb)?
2) How can I get the position of the cursor (i.e. row and col)?
3) Unlike the TRichEdit component, TMemo component does not have the OnSelectionChange event. I need to display the position of the cursor whenever the cursor is moved. How can I do this?
Thanks in Advance
Ermac
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'll try to find a solution. : this is already one, but I guess there should be better :
At onkeydown or onkeyup, if Insert key is pushed, toggle a boolean variable between false and true (overwrite and insert)
Check if overwrite is selected :
if so, first delete character your cursor is on then write the character down. You can put this code in Onkeypress
At onkeydown or onkeyup, if Insert key is pushed, toggle a boolean variable between false and true (overwrite and insert)
Check if overwrite is selected :
if so, first delete character your cursor is on then write the character down. You can put this code in Onkeypress
ASKER
Have already tried that... However it seems that the Memo flashes a lot when doing this...
Any other solutions??
Any other solutions??
Still thinking...
ASKER
Or was it because my code was wrong??
Here's my piece of code for doing it...
with Editor do
begin
if OverwriteText then
if (GetTextLen > 0) and (Text[SelStart+1] <> '') and (Text[SelStart+1] <> #13) then
SelLength := 1;
end;
Here's my piece of code for doing it...
with Editor do
begin
if OverwriteText then
if (GetTextLen > 0) and (Text[SelStart+1] <> '') and (Text[SelStart+1] <> #13) then
SelLength := 1;
end;
No, looks correct. Maybe with selection lot's of repaint.
Thought otherway, just write VK_DELETE and then character, but
I can't get it to work properly
Thought otherway, just write VK_DELETE and then character, but
I can't get it to work properly
ASKER
Have played with the VK_DELETE too...
Could get it to work but it still flashes a lot :(
Could get it to work but it still flashes a lot :(
Sorry, can't find a better solution, maybe there isn't any :-(
Maybe make a new TMemo component?
Maybe make a new TMemo component?
ASKER
Anyway thanks for your help! :)
ASKER
But I got another question to ask...
How do I implement Insert/Overwrite operations using TMemo??
(30 points for this answer)