• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

Draw on Main menu

Hi
Could somebody tell is it possible to draw on the main menu. I have an Image component on the main form and I'd like to draw (copy) the picture in the Image to the right side on the main menu.
0
vterekh
Asked:
vterekh
1 Solution
 
kretzschmarCommented:
yes, it may possible,
depending what delphi version you use,

could you tell us this?
0
 
vterekhAuthor Commented:
Of course
I use Delphi 6.
0
 
kretzschmarCommented:
well, i must guess now,
no delphi on hand and no d6 available to me

there should be a ownerdraw-property, if so, set it to true
then there should be events OnDrawItem or OnDrawItemImage, which are providing a canvas and a rect, to which you can copy your image.

this is just from head and i may wrong, maybe this property/event must be adjusted to the menu-component, where the menuitem is assigned to

meikl ;-)
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Mohammed NasmanSoftware DeveloperCommented:
0
 
vterekhAuthor Commented:
There's a problem with OwnerDraw property. When it's TRUE and ShortCut was chosen for some menu item then menuitem's caption laps partly the ShortCut name.
0
 
gemartiCommented:
Let me give this a try...

Create a new form
Add A MainMenu component
Add some menu items.
Select a bitmap for the MainMenu properties
Add an imagelist and add some images to the list
Now select imageindex in the main menu properties and select an image for each subindex item on the main menu.


0
 
vterekhAuthor Commented:
2 gemarti:
I wanted to draw not in the area of MenuItem
For example the menu width equal the width of the window it belongs. As usual the last menu item (i mean main menu item, not popup items) don't reach the right size of menu bar. I'd like to draw on the empty part of menu bar.

Nevertheless I've solved this problem using some kretzschmar's ideas. The example suggested by mnasman discribe the same way, but kretzschmar was the first :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now