Disabling a TMemo without getting gray text (Views: 101)
I want to set Enabled=False in my TMemo, but I don't want the text to turn gray.
Ok, this is a dirty trick. But is works fine for me.
Set the Enabled to True (yes realy).
In the OnEnter event of your memo put:
procedure TForm1.MyMemoEnter(Sender: TObject);
Now, focus will be forced to some other control every time your user tries to fucus on your memo. To the user it seems that the memo is disabled.
This one is much simpler:
Put the memo on a panel. Then set Panel.Enabled=False.
Ok, this works if you can put the memo on a panel. Just with inherited forms you can get into some trouble. But is should work for most people.
<< Back to main page