Recent

Author Topic: tmemo won't take keyboard input.  (Read 1732 times)

gjunk

  • New Member
  • *
  • Posts: 35
tmemo won't take keyboard input.
« on: July 18, 2025, 05:45:13 pm »
I have a form with 2 Tedit fields, 2 buttons and a memo field.
I can edit the tedit fields and I can tab to the buttons and the memo field.
When I am on the tedit or buttons they are highlighted showing me that they are selected.
When I am over the memo I don't see a curser and no keyboard input is accepted.
What am I doing wrong?

Aruna

  • Hero Member
  • *****
  • Posts: 805
Re: tmemo won't take keyboard input.
« Reply #1 on: July 18, 2025, 06:05:28 pm »
I have a form with 2 Tedit fields, 2 buttons and a memo field.
I can edit the tedit fields and I can tab to the buttons and the memo field.
When I am on the tedit or buttons they are highlighted showing me that they are selected.
When I am over the memo I don't see a curser and no keyboard input is accepted.
What am I doing wrong?
It sounds like your TMemo control is not receiving focus properly, which is why you're not seeing a cursor and cannot type into it. Here are a few common things to check and try:
Ensure TMemo.Enabled := True;

If Enabled is set to False, it will not accept focus or input. Check: In the Object Inspector or in code:
Code: Pascal  [Select][+][-]
  1. memo1.Enabled := True;

Ensure TMemo.ReadOnly := False;
If ReadOnly = True, you won't be able to type into it (but you should still see a cursor).

Check:
Code: Pascal  [Select][+][-]
  1. memo1.ReadOnly := False;

Try this minimal example in a new project:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   Edit1.Text := 'Edit me';
  4.   Edit2.Text := 'Or me';
  5.   Memo1.Lines.Text := 'Try typing here...';
  6. end;
  7.  
  8. procedure TForm1.Button1Click(Sender: TObject);
  9. begin
  10.   Memo1.SetFocus;
  11. end;
  12.  
If you post your code/unit that helps us to help you :)

Joanna

  • Hero Member
  • *****
  • Posts: 1452
Re: tmemo won't take keyboard input.
« Reply #2 on: July 18, 2025, 11:02:30 pm »
I have a form with 2 Tedit fields, 2 buttons and a memo field.
I can edit the tedit fields and I can tab to the buttons and the memo field.
When I am on the tedit or buttons they are highlighted showing me that they are selected.
When I am over the memo I don't see a curser and no keyboard input is accepted.
What am I doing wrong?
does memo have tabstop enabled?

gjunk

  • New Member
  • *
  • Posts: 35
Re: tmemo won't take keyboard input.
« Reply #3 on: July 21, 2025, 11:07:44 am »
My problem was that I couldn't see the left side of the memo and it didn't look like anything was happening.
It's working now.

Thank you.

 

TinyPortal © 2005-2018