?
Solved

Keyboard Insert Key (Overwrites) doesn't work

Posted on 2001-07-25
7
Medium Priority
?
556 Views
Last Modified: 2010-05-18
It seems that the TEdit doesn't recognise the keyboard insert key (toggle to overwrite/insert), it is always in
insert state!

Can anyone help?

Thanks.



0
Comment
Question by:llkhor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 27

Assisted Solution

by:kretzschmar
kretzschmar earned 100 total points
ID: 6320969
you've to check this byself

you could do this on the keyup event using the keystate-api
if overwrite is set just set the sellength of the tedit to 1


meikl ;-)
0
 
LVL 4

Accepted Solution

by:
jsweby earned 100 total points
ID: 6321620
To elaborate on meikl's answer, from the Borland Community (just use Edit instead of Memo):

The Windows TEdit and TMemo controls have no overwrite capability. It is possible to emulate this behavior however, by setting the SelLength property of the edit or memo control to one during the processing of the KeyPress event. This causes the character at the current position of the caret to be overwritten.

The following example demonstrates emulation of an overwrite capability of a TMemo component. The state of the overwrite mode can be toggled by pressing the insert key.

Example:

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    procedure Memo1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure Memo1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
    InsertOn : bool;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if (Key = VK_INSERT) and (Shift = []) then
    InsertOn := not InsertOn;
end;

procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
  if ((Memo1.SelLength = 0) and
      (not InsertOn)) then
    Memo1.SelLength := 1;
end;

J.
0
 

Author Comment

by:llkhor
ID: 6357838
thanks for your feedback. :-)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 26

Expert Comment

by:Russell Libby
ID: 8733784
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

To split points between kretzschmar and jsweby

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8733837
hi russell,

you are quite busy,
guessing i should begin too

can i ask you, where you provide the links
of the questions you have already tagged?

meikl ;-)
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8733995

Meikl,

A little busy, only have 3 wks worth of q's to look at now... ;-)

I have been keeping the list in notepad currently, then when the final list/assignment is complete we are supposed to post them at:

http://www.experts-exchange.com/Community_Support/CleanUp

In a format that is similar to
-----------------------------------

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20136904.html 
- To be deleted and points refunded

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20137079.html -
To be deleted and points refunded

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20137464.html -
PAQ/Refund

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20137508.html -
To be deleted and points refunded

-----

If I misunderstood, and you want to SEE the list i have so far, let me know and I can post it for you.


Best Regards,
Russell

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question