Results 1 to 6 of 6

Thread: Menus and a return to first month programming

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 1999
    Location
    Sydney,NSW,Australia
    Posts
    178

    Question Menus and a return to first month programming

    Not seeing anyway of creating an index for menu items. Are we meant to return to the days of creating a procedure for each menu element, or am l missing something here?

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Menus and a return to first month programming

    Originally posted by jritchie
    Not seeing anyway of creating an index for menu items. Are we meant to return to the days of creating a procedure for each menu element, or am l missing something here?
    well, so far I have answered all of your questions wrong this is another one:
    control arrays dont exist in vb.net, so the menu items dont return an index. and no, you dont have to create a sub for each one. You add the menu name after the handles statement. kinda like this:
    VB Code:
    1. Private Sub Menu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) [color=red][b]Handles[/b][/color] MenuItem2.Click, MenuItem3.Click     '  , Control.Event, Control.Event, ..............
    2.  
    3. End Sub
    probably another wrong answer, but I tried
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 1999
    Location
    Sydney,NSW,Australia
    Posts
    178
    Thanks Mr P.... damn MS taking the control arrays out..... *grumble*

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    If you like to add an event handler at runtime, you can use AddHandler.

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Originally posted by jritchie
    Thanks Mr P.... damn MS taking the control arrays out..... *grumble*
    Im glad they took em out. They are unnecessary at best in .NET. First off, since everything is an object anyway, you can have an array of objects, but not like the control array as you maybe used to, but still virtually the same idea. But also since when you create controls, you addthem to a control collection which makes using a control array a wasted of recources since now you have in sense, 2 collections of the same controls. Wasteful!
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 1999
    Location
    Sydney,NSW,Australia
    Posts
    178
    So Mr Anderson how would you add a menu object to an object array? Simply define the array and pop the menu into it or something?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width