PC Review


Reply
Thread Tools Rate Thread

A better way? Getting Menu Item Collection Into ContextMenu?

 
 
Schorschi
Guest
Posts: n/a
 
      7th Apr 2004
Ok the following works... but is ugly and static, need the same idea
but dynamic, so as the 'theOwner' form main menu is defined,
NotifyIcon.ContextMenu can be updated.

Dim the0 As MenuItem = theOwner.Menu.MenuItems(0)
Dim the1 As MenuItem = theOwner.Menu.MenuItems(1)

Dim theItems As MenuItem()

ReDim theItems(1)
theItems(0) = the0
theItems(1) = the1

NotiyIcon.ContextMenu = New ContextMenu(theItems)

I can get the Menu Items Collection, but can not seem to get the
collection converted to a MenuItem() array? That ContextMenu wants.
Thx in advanced.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent ContextMenu from closing and menu item size Flack Microsoft Dot NET Framework Forms 0 11th Feb 2008 10:22 PM
In Menu Control's item collection, setting .Selected=false doesn't work if children present Wayne Erfling Microsoft ASP .NET 0 13th Oct 2006 02:24 PM
ContextMenu selected menu item index Webermax Microsoft C# .NET 0 20th Jun 2005 11:01 AM
key/value collection that allows key string to be updated and retains collection item entry order dx Microsoft Dot NET Framework 2 25th Sep 2004 05:51 PM
PopUpMenu - ContextMenu main menu item fails to call function Jasim Microsoft Dot NET 0 15th Sep 2003 09:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:20 AM.