请问!如何编程实现带BAR的图形菜单?(实在没分了,不好意思:((0分)

N

nuke

Unregistered / Unconfirmed
GUEST, unregistred user!
就象win9x的开始菜单一样,左边有一个竖着的条.右边是菜单项.
如何实现之!请指点!

 
不用控件的,请问该如何做?
 
来自uddf的解决方案:
var
Bmp1 : TPicture;

...

Bmp1 := TPicture.Create;
Bmp1.LoadFromFile('c:/where/b1.BMP');
SetMenuItemBitmaps( MenuItemTest.Handle,
0,
MF_BYPOSITION,
Bmp1.Bitmap.Handle,
Bmp1.Bitmap.Handle);
...

--------------------------------------------------------------------------------
Create a Picture.
Load a .BMP from somewhere into the picture.

Use the SetMenuItemBitmaps API call to connect the Picture to the Menu with these parameters :


MenuItemTest is the name given to the horizontal Menuitem
0,1 ... is the position of the item on which you want to place the bitmap. (start counting with 0)
The first of the two bitmap-handles is the one for the bitmap displayed for the unchecked menuitem.

The second is the one for the checked menuitem. These can be the same or not.

All this can by coded in the .Create of a form.

Result : It works, but only the right-top of the bitmap is displayed. Rest us to change the height and/or width of the menuitem according to the bitmap
 
接受答案了.
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
873
DelphiTeacher的专栏
D
D
回复
0
查看
773
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
顶部