Link to home
Start Free TrialLog in
Avatar of fibdev
fibdev

asked on

popup menu

Hello All,

My question is this...

How do I make my popup menu look like this: http://fibdev.com/images/cboxmenu.png

Keep in mind I want to have custom menu items in the menu.

Thanks,

Gabe
Avatar of rwilson032697
rwilson032697

Gabe,

You can use an imagelist to hold the icons on the left hand side. Set this imagelist to the images property of the popup menu. Then set the image index property of each item in the popup menu to refer to the appropriate image in the imagelist.

The 'Alt+F4' shortcut can be set with the shortcut property in the menu item.

Cheers,

Raymond.
I'm not sure which particular aspects of the illustrated pop-up you want, but here are some of tyhe things that you may need to know.

The images down the left side are done by assigning an imagelist to the menu and the setting the ImageIndex property.

The bolding of the top item is done by setting the Default property to True.

The disabled items (greyed) have Enabled = False.

The line is a menu item with a caption of '-'.

The Alt+F4 on Close relates to the ShortCut property.

Is that what you needed?
Avatar of fibdev

ASKER

Sorry I was not clear...

I want to have form control items displayed in the menu.
<for control items>
you can add them as normal and give events like :

procedure TForm1.Maximize1Click(Sender: TObject);
begin
Perform( WM_SYSCOMMAND, SC_MAXIMIZE, 0 );
end;

procedure TForm1.Minimize1Click(Sender: TObject);
begin
Perform( WM_SYSCOMMAND, SC_MINIMIZE, 0 );
end;

also SC_RESTORE, SC_MOVE , SC_CLOSE etc..
ASKER CERTIFIED SOLUTION
Avatar of mYong
mYong

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fibdev

ASKER

I figured this one out on my own.  I don't think I was clear about what I was after from the start.  I wanted to make my popup menu display the control box images for "Close" and "Restore".

I ended up just using bitmaps.  My question was to see if there were some way to do this programaticly.

Thank you all for your input.