开发者

Powerbuilder: Trying to set the currentitem for a menuCascade

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 开发者_StackOverflowline 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜