Delphi/CB
•  Greatis •  Security •  AppDatabase •  Utilities •  Visual Basic • .NET •  just4fun
Delphi / C++ Builder
Components, utilities and tips for Delphi and C++ Builder developers
More info
Form Designer FAQ
Form Designer Home
Delphi Components
See also
Products
Object Inspector
Runtime Fusion
Print Suite
Commented Image
Image Editor  new!
Delphi Toys
Ultimate Pack  hot!

FAQs
Object Inspector FAQ
Print Suite FAQ
Image Editor FAQ

Links
Software for .NET
Software for VB 6
Delphi Tips & Tricks

Services
Outsourcing
Using popup menu
TFormDesigner disables all the popup menus of all edited controls and the popup menu of the form when component is active, but you can use your own popup menu that can be used by the PopupMenu property of TFormDesigner. If this property is assigned, the popup menu is shown when the user clicks the right mouse button over the edited control. The contents of the menu can be edited using OnPopup event of the popup menu and the read-only MenuControl property of TFormDesigner. The MenuControl property contains the control, clicked by right mouse button. The code below shows/hides the menu items depending the type of control from the MenuControl property.
procedure TForm1.PopupMenu1Popup(Sender: TObject);
begin
  with (Sender as TPopupMenu),FormDesigner1 do
  begin
    EditButtonMenuItem.Visible:=MenuControl is TButton;
    EditLabelMenuItem.Visible:=MenuControl is TLabel;
  end;
end;

Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2008 Greatis Software