all is in the title. I did not find a way to do this.
any help ? thanks.
For Cocoa:
[code]Me.AddRow(“A”)
Me.AddRow(“B”)
Me.AddRow(“C”)
Me.AddRow(“D”)
Me.AddRow(“E”)
Declare Sub setAutoenablesItems Lib “AppKit” Selector “setAutoenablesItems:” (NSPopupButton As Ptr, value As Boolean)
Declare Function itemAtIndex Lib “AppKit” Selector “itemAtIndex:” (NSPopupButton As Ptr, index As Integer) As Ptr
Declare Sub setEnabled Lib “AppKit” Selector “setEnabled:” (NSMenuItem As Ptr, value As Boolean)
Dim p As Ptr = Ptr(Me.Handle)
setAutoenablesItems(p, False)
setEnabled(itemAtIndex(p, 2), False)
setEnabled(itemAtIndex(p, 4), False)[/code]
[quote=322727:@Eli Ott]For Cocoa:
[code]Me.AddRow(“A”)
Me.AddRow(“B”)
Me.AddRow(“C”)
Me.AddRow(“D”)
Me.AddRow(“E”)
Declare Sub setAutoenablesItems Lib “AppKit” Selector “setAutoenablesItems:” (NSPopupButton As Ptr, value As Boolean)
Declare Function itemAtIndex Lib “AppKit” Selector “itemAtIndex:” (NSPopupButton As Ptr, index As Integer) As Ptr
Declare Sub setEnabled Lib “AppKit” Selector “setEnabled:” (NSMenuItem As Ptr, value As Boolean)
Dim p As Ptr = Ptr(Me.Handle)
setAutoenablesItems(p, False)
setEnabled(itemAtIndex(p, 2), False)
setEnabled(itemAtIndex(p, 4), False)[/code][/quote]
…and is there a Windows version?? This could be useful for my project as well. Better still…why not create a menu and just assign it to the PopupMenu Control?? I know you can’t do that but it would be useful.
Cheers
Grant
You can affect a menuItem to a Contextual Menu with PopUp. Then indeed you can enable or disable menuItems at will.
Do someone has a Windows version of this? I need it very much…
Tried to understand which native control is in Windows framework, to find declares myself, but failed.
Is the PopupMenu a ComboBox or what?