tonwelzt 发表于 2008-7-21 13:29:32

请高手指点SetMenuBarAttribute和SetCtrlMenuAttribute用法的区别

intSetMenuBarAttribute (int menuBarHandle, int menuOrMenuItemID,
                                              int    menuBarAttribute, ...);
intSetCtrlMenuAttribute (int panelHandle, int controlID, int menuItemID,
                                              int ctrlMenuAttribute, ...);
在程序的主面板上有菜单项。在菜单项的回调函数中我用 SetMenuBarAttribute来修改菜单的属性都是可以的。但现在我需要在别的控件的回调函数中也能修改菜单的属性,我也使用SetMenuBarAttribute,但调试时通知我找不到菜单的ID。我换用SetCtrlMenuAttribute时同样出错,出错信息如下:

NON-FATAL RUN-TIME ERROR
      Library function erroe.Controls of the type passed do not have a menu.
不知道这是什么原因?是参数不对吗?为什么提示说找不到菜单呢?另外这俩个函数在使用上有那些区别呢?我也看过他们的help,只能看出来其功能基本一致。请各位帮我分析一下,在使用这两个函数时都应该注意那些问题。

cpubbs 发表于 2008-7-21 19:46:36

兄弟最好上传程序,易于分析程序错误!
页: [1]
查看完整版本: 请高手指点SetMenuBarAttribute和SetCtrlMenuAttribute用法的区别