Solved

Draw on Main menu

Posted on 2001-07-25
7
246 Views
Last Modified: 2010-04-06
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
Comment
Question by:vterekh
7 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6316454
yes, it may possible,
depending what delphi version you use,

could you tell us this?
0
 
LVL 1

Author Comment

by:vterekh
ID: 6316459
Of course
I use Delphi 6.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 6316497
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 22

Expert Comment

by:mnasman
ID: 6316514
0
 
LVL 1

Author Comment

by:vterekh
ID: 6317150
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
 
LVL 21

Expert Comment

by:gemarti
ID: 6317453
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
 
LVL 1

Author Comment

by:vterekh
ID: 6322097
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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now