...disable a MenuItem without greying it?

Author: Loïs Bégué
Homepage: http://www.begue.de

Category: Forms

procedure TForm1.Button1Click(Sender: TObject);
var
  
M: TMenu;
begin
  
M := Application.MainForm.Menu;
  // Den ersten Menueintrag deaktivieren
  // The first Item will be disabled
  
EnableMenuItem(M.Handle, M.Items[0].Command, MF_BYCOMMAND or MF_DISABLED);
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base