Powerbuilder:尝试设置菜单级联的当前项目

发布于 2024-08-10 19:22:52 字数 459 浏览 1 评论 0原文

请告诉这个新手。

我有一个菜单,其对象类型设置为菜单级联。我可以很好地引用菜单中的项目,甚至可以将这些项目设置为启用或可见。但我不能做的是设置菜单的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪眸﹌ 2024-08-17 19:22:52

您需要将该项目分配给 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文