Questions tagged [tmenuitem]

tmenuitem is a non visual VCL component describing the properties of an item in a menu. It is defined in the Menus.pas unit.

9 questions
7
votes
2 answers

Creating a Delphi app shortcut with no corresponding menu item

I want to have a shortcut key combination (like Ctrl+Alt+D) in my app to invoke a function, but I don't want the shortcut to appear on any menu. Is it possible to have a shortcut available in your app that is otherwise invisible?
rossmcm
  • 5,493
  • 10
  • 55
  • 118
4
votes
0 answers

CBuilder TMenu showing in wrong place

I have a Form that needs to be embedded in another Form. I'm placing on TCard: EmbeddedForm->Parent = ACard; EmbeddedForm->BorderStyle = bsNone; EmbeddedForm->Align = alClient; EmbeddedForm->Show(); All is working well, except that menus on the…
iplayfast
  • 140
  • 10
3
votes
6 answers

Sending WM_COMMAND to a TMenuItem

In my Delphi form's OnShow method, I determine that a dialog must be opened automatically once the form is opened - and I should be able to do this by simulating a click on a menuitem. However, calling menuitem.Click brings up the dialog before the…
Roddy
  • 66,617
  • 42
  • 165
  • 277
2
votes
2 answers

Delphi firemonkey how to remove a menuitem programmatically?

How can I remove a menuitem I dynamically added to a menu? I add dynamically menu items with for example: m:=TMenuItem.Create(nil); m.Text:='bla bla bla'; mnuMain.AddObject(m); I could not find ANY function to remove the entry again. I tried…
user7415109
2
votes
2 answers

Delphi: How to Assign an Up Arrow Keyboard Shortcut to Action/MenuItem, and Keep It Actual for Navigating the List Control (ListBox/VTV)?

Please assist me: How to assign an up arrow keyboard shortcut to action or menu item, and keep it actual for navigating the list control (e.g. ListBox/Virtual Treeview/other) at the same time? Thanks!
1
vote
1 answer

How to draw transparent bitmap from ImageList on TMenuItem?

I need to draw a transparent bitmap on a TMenuItem. Despite trying for many hours with different methods I could not succeed: var NewItem: TMenuItem; ThisBmp: TBitmap; begin NewItem := TMenuItem.Create(pmSendToCustomTool); NewItem.Caption :=…
user1580348
  • 5,721
  • 4
  • 43
  • 105
1
vote
1 answer

How to find TMainMenu parent of TMenuItem?

I have a standard TMainMenu which contains some TMenuItem elements. How can I find dynamically a parent main menu object from one of them? The following code brings a compiler error already in the first executable line: procedure…
Jacek Krawczyk
  • 2,083
  • 1
  • 19
  • 25
0
votes
1 answer

Howto create same style of tMenuItem with AdvancedDrawItem?

I would like to add a Line with a specific color for each MenuItem of popup menu in Tokyo VCL app. The Style is "Amethyst Kamri". I'm invoked the AdvancedDrawItem event of each MenuItem as below. However, the hilighted box is flat and has not the…
Reron
  • 181
  • 11
0
votes
1 answer

In Lazarus, how to check whether a MenuItem has a Bitmap assigned?

I wrote some Lazarus code that loops through the menu items of the main menu and needs to see whether there's a bitmap assigned to each menu item. I tried to check with if Assigned (MenuItem.Bitmap) then... but this always returns true, whether a…
lyle
  • 757
  • 1
  • 7
  • 18