Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / December 2006

Tip: Looking for answers? Try searching our database.

Dynamic menu and item clicked

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
William LaMartin - 26 Dec 2006 04:36 GMT
I recall being able to do this in Vb.net, but I can seem to find a way to
accomplish it in the compact framework.

I want to connect to a compact SQL database, get the list of tables and
display them in a menu. I have no trouble doing this.  My problem begins
when I want to retrieve the text of the menu item when one of these
dynamically created menu items is clicked.

In VB.net  I could add an item to the menu as follows.

mnuMain.MenuItems.Add("Menu Caption", AddressOf MenuItem_Click)

That allowed me to associate  handler for the click event.  However, in the
compact framework I can only add a Windows.Forms.MenuItem--with no method
that I see of associating a click event handler.

What is my solution?
Daniel Moth 2 - 26 Dec 2006 05:06 GMT
Your solution is to add an event handler to the menuitem (with
AddHandler) before adding it to the collection.

Cheers
Daniel
--
http://www.danielmoth.com/Blog

> I recall being able to do this in Vb.net, but I can seem to find a way to
> accomplish it in the compact framework.
[quoted text clipped - 13 lines]
>
> What is my solution?
William LaMartin - 26 Dec 2006 15:27 GMT
Thanks very much.  That did the trick.

> Your solution is to add an event handler to the menuitem (with
> AddHandler) before adding it to the collection.
[quoted text clipped - 22 lines]
>>
>> What is my solution?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.