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

  • 主题发起人 主题发起人 nuke
  • 开始时间 开始时间
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
 
接受答案了.
 
后退
顶部