delphi PopupMenu

delphi PopupMenu
 
取消PopupMenu菜单后面自动加了字母:
把PopupMenu的AutoHotKeys属性设置为maManual就可以了
////
procedure  TForm1 . Del1Click ( Sender :  TObject );
begin
  if  PopupMenu1 . PopupComponent  =  listbox1  then  ListBox1 . DeleteSelected ;
  if  PopupMenu1 . PopupComponent  =  listbox2  then  ListBox2 . DeleteSelected ;

end ;

procedure  TForm1 . FormCreate ( Sender :  TObject );
begin
   PopupMenu1 . AutoPopup  :=  True ;
   listbox1 . PopupMenu  :=  PopupMenu1 ;
   listbox2 . PopupMenu  :=  PopupMenu1 ;
end ;

procedure  TForm1 . Clear1Click ( Sender :  TObject );
begin
  if  PopupMenu1 . PopupComponent  =  listbox1  then  ListBox1 . Clear ;
  if  PopupMenu1 . PopupComponent  =  listbox2  then  ListBox2 . Clear ;
end ;
 




你可能感兴趣的:(Delphi)