Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to Paint the Form Menu bar Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
13-Jul-03
Category
VCL-Forms
Language
Delphi 4.x
Views
174
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Ido Kanner

When i uses programs like the game freecell that comes with windows 9x i see that 
there is a text in the menu bar tht tells me how many cards left me. 

How can i make something like that in my programs ?

Answer:

Well, First of all we need to put a main menu component on our form. 
Now set the OwnerDraw property to true. 

If you have an item that you wish to paint by yourself, now is the time to create 
it and to make the OnDrawItem. 
In this line you put also this line: 

1   {... }
2   ACanvas.TextOut(1, ARect.Top + 1, 'I''m in the MainMenuDrawbar');
3   {... }


Note, If you need to use a changed variable you can do it from another function and 
ll you need to do afther the change is to call the API function DrawMenuBar. 

If you are using Delphi 2,3 Use the Messages WM_MESUREITEM and the message WM_DRAWITEM to make this effect.

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC