English 中文(简体)
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 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

最佳回答

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.

问题回答

暂无回答




相关问题
How do I insert ToolBar separators when binding ItemSource

I am binding a ToolBar to a collection of command view model objects. The objects in the collection have a property IsSeparator that when true I would like represented with a <Separator/> in ...

Outlook shortcuts style toolbar in Qt

Is there any way to create outloook shortcuts style toolbar in Qt? Should use normal toolbar and try to style it somehow (I have little idea how to achieve this)? Or does Qt provide builtin widget for ...

How does Google get a toolbar right below the tabs in IE?

I researched through all BHO related documentation, but I just can t figure how Google gets the translation toolbar right below the tabs in IE. Any useful pointers how to achieve the same effect for ...

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 ...

热门标签