Powerbuilder:尝试设置菜单级联的当前项目
请告诉这个新手。
我有一个菜单,其对象类型设置为菜单级联。我可以很好地引用菜单中的项目,甚至可以将这些项目设置为启用或可见。但我不能做的是设置菜单的 currentItem 属性。我在屏幕的打开事件中有这样的代码。
menu qq
qq = this.menuid.item[3].item[19]
qq.visible = true //OK
qq.item[3] = qq.item[3] //OK
qq.currentitem = qq.item[3] //Error during the compile
// The line above gives the following error
// C0019: Incompatible property currentitem for type menu
我很确定这是一个简单的修复,但 PowerBuilder 还不是我的朋友
Please clue this newb in.
I've got a menu with it's object type set to menu cascade. I can reference the items in the menu just fine and I can even st the items to enabled or visible. But what I can't do is set the currentItem property of the menu. I have code like this in the open event of a screen.
menu qq
qq = this.menuid.item[3].item[19]
qq.visible = true //OK
qq.item[3] = qq.item[3] //OK
qq.currentitem = qq.item[3] //Error during the compile
// The line above gives the following error
// C0019: Incompatible property currentitem for type menu
I pretty sure it's an easy fix but PowerBuilder is not my friend yet
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将该项目分配给 menucascade 类型的变量。我会将代码放入 Try...Catch 块中,以防稍后修改菜单。
You need to assign the item to a variable of type menucascade. I would put the code inside a Try...Catch block in case the menu is later modified.