I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

July Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi VCL Topic   Print This     

Two TMainMenu on the main form .. is it possible??

Two TMainMenu on the main form .. is it possible?? in Delphi VCL topic (part of our Pascal and Delphi Coding group).

Quick Search: TMainMenu   possible   Two TMainMenu   Two TMainMenu main   form it  
programc++
-- USA
Hello,
I am developing an application where there is a main form. This main form has a TMainMenu with all the necessary drop down menu items. Now I have a MDI child window which changes according to the menu item selected from TMainMenu. Depending on which MDIchild window I am opening, I need one more Menubar on the main form which is similar to the main TMainMenu. I tried using another TMainMenu on the main form. But during run time it is not displayed. Can anyone help me with this .Any other suggested solution will be appreciated.

Thanx
Mahendra Ghuge
 Posted 16 years ago (Thread Starter)
Comment Quote
About programc++ -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #10512, 7 replies
Thread Started 6/4/2004 6:42:00 AM
View Counter=4358
Location=-- USA 
Joined=16 years ago   MB Posts=14  
Angel
 (Inactive)
England
From memory, you may only have one Mainmenu component. Do you need the second menu on the MDI child form, or on the main form along with the other menu?

Have you looked at the Toolbar component under the Win32 tab of Delphi? You can use this to create some good looking menu options. If you still need the drop down functionality, one way would be to create the menu buttons yourself (i.e. Filem Edi, Search) and whenever the user clicks on the button, have a popupmenu appear directly underneath the button. This gives the effect of a main menu. You can set the location of the popup menus relative to the buttons position on your form.

Unless somebody else out there know how to make the system accept two main menus...?
 Posted 16 years ago
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #10513 (Level 1.1)  Reply to 10512
Thread Started 6/4/2004 7:04:00 AM
View Counter=2
Location=England  
Joined=19 years ago   MB Posts=199  
Angel
 (Inactive)
England
Okay,

First off, the Toolbar itself has a property in the Object Inspector entitled ShowCaptions. Set this to True to be able to see the captions on the buttons.

Secondly, set an Onclick action to the button and in there enter the code to manually execute the popupmenu.

PopupMenu1.Popup(X,Y);

X is the Horizontal axis (integer) and Y is the vertical value. You should be able to work out these values based on the buttons position on the form.

HTH
 Posted 16 years ago
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #10516 (Level 1.2)  Reply to 10512
Reply Posted 6/4/2004 7:51:00 AM
Location=England  
Joined=19 years ago   MB Posts=199  
Wes Peterson
Prestwood IT
Prestwood IT office in Citrus Heights, CA
To invoke the pop-up menu with a left-click, simply add an OnClick handler, check for a left-click and invoke the pop-up.

Wes Peterson
Senior Software Engineer
Prestwood IT Solutions
http://www.prestwood.com

 Posted 16 years ago
Comment Quote
About Wes Peterson -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Wes Peterson

Wes Peterson is a Senior Programmer Analyst with Prestwood IT Solutions where he develops custom Windows software and custom websites using .Net and Delphi. When Wes is not coding for clients, he participates in this online community. Prior to his 10-year love-affair with Delphi, he worked with several other tools and databases. Currently he specializes in VS.Net using C# and VB.Net. To Wes, the .NET revolution is as exciting as the birth of Delphi.


Post ID #10517 (Level 1.3)  Reply to 10512
Reply Posted 6/4/2004 8:02:00 AM
Location=Prestwood IT office in Citrus Heights, CA 
Joined=16 years ago   MB Posts=158   KB Posts=163   KB Comments=34   BLOG, Topics=20  
programc++
-- USA
Hi,
Thanks for your reply. I am trying different way to solve this issue. One I found was to use TToolButton and in the Object Manager set the style to tbsDropDown. Now this looks fine to me as far as the functionality is concerned but not the appearance. I have a small problem here though . I tried to assign a name to tis TToolbutton through caption on the object manager, but doesnt seem to display anything. Any idea why???
I am trying the solution that you provided to me here too. Yes I need the 2nd menu item on the Main form not the child form.
Thanks again for your response
 Posted 16 years ago (Thread Starter)
Comment Quote
About programc++ -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #10514 (Level 1.4)  Reply to 10512
Reply Posted 6/4/2004 7:17:00 AM
Location=-- USA 
Joined=16 years ago   MB Posts=14  
programc++
-- USA
hi again,
i tried using popup menu option as per your instruction, but the the pop menu is displayed only on right click not the left click which I need. Any suggestion??
 Posted 16 years ago (Thread Starter)
Comment Quote
About programc++ -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #10515 (Level 1.5)  Reply to 10512
Reply Posted 6/4/2004 7:33:00 AM
Location=-- USA 
Joined=16 years ago   MB Posts=14  
programc++
-- USA
Hello,
I know this is a silly question.. but cant really get around with this.. may be i am too tired to think .. Please do help me.. I am using OnClikc handler and then using
PopupMenu1->Popup(100,500);
This is just a one line code:

void __fastcall TMainForm::Button1Click(TObject *Sender)
{
PopupMenu1->Popup(100,500);
}

This is giving me a weird error:
[Linker Error] Unresolved external '__fastcall TMainForm::Popup(System::TObject *)' referenced from C:\PROJECT\DATABASE\MAIN.OBJ

Can i get some help eith this please..
thanks in advance
Mahendra Ghuge
 Posted 16 years ago (Thread Starter)
Comment Quote
About programc++ -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #10518 (Level 1.6)  Reply to 10512
Reply Posted 6/4/2004 8:47:00 AM
Location=-- USA 
Joined=16 years ago   MB Posts=14  
Most Recent Post
programc++
-- USA
Hello,
I got it working. Works fine now. Thanks alot Angel and Wes for all your help appreciate it
 Posted 16 years ago (Thread Starter)
Comment Quote
About programc++ -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #10519 (Level 1.7)  Reply to 10512
Reply Posted 6/4/2004 9:10:00 AM
Location=-- USA 
Joined=16 years ago   MB Posts=14  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P195A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #10512 Counter
4358
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech