Disabing right click on TEdit

Components such as TEdit have a default popup right click menu that shows undo, cut, copy, etc... I want to disable that menu so that it does not show up ?

I had the following solution working:  Link the PopupMenu property of your TEditcontrol to the popup component.  Set the AutoPopup property of the component to False.

It no longer works in D5. Any other suggestions?
moonriseAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwilson032697Commented:
Put a TPopupMenu componetn on your form, with no entries. Set the popup property for the edit to that popup menu.

When you right click nothing happens (popup-wise...)

Cheers,

Raymond.
0
rwilson032697Commented:
Oh yes - this is in D5...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rwilson032697Commented:
A note as to why you rejected the (working) answer would be nice...

Raymond.
0
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

intheCommented:
another way:

public
    procedure AppMessage(var Msg: TMsg; var Handled: Boolean);
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
begin
Handled := False;
if (Msg.hwnd = Edit1.Handle) then
begin
if (Msg.Message = WM_RBUTTONDOWN) or (Msg.Message = WM_RBUTTONUP)then
handled:=True
else Handled := False;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
 Application.OnMessage := AppMessage;
end;
0
intheCommented:
huh i though this was answered.
oh well i'll only leave as comment for now.
0
intheCommented:
note:
  what i put should work on edits, memo1,richedits etc  but  i thought raymonds way did also.
0
rwilson032697Commented:
It was answered...
0
moonriseAuthor Commented:
Sorry Raymond,

I read your answer then your comment and I thought your comment meant that you had just realized I was looking fot a D5 solution. Your solution is what I was already doing but for some reason it stopped working. Just to make sure I create a new empty TPopupMenu and now it works (stange since my existing one was just as empty).

Anyway, I thought your comment was meant to tell me to ignore your answer. It in fact works and you can have the points.

Thank you.
0
rwilson032697Commented:
Moonrise: No problems!

Cheers,

Raymond.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.