Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Help! How to solve this problem?

Help! How to solve this problem?

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    In the following code: ------------------------------------- Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click, MenuItem2.Click, MenuItem3.Click ..... End Sub -------------------------------------- How to determine which menuItem is clicked? Thanks.

    R T 2 Replies Last reply
    0
    • A Anonymous

      In the following code: ------------------------------------- Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click, MenuItem2.Click, MenuItem3.Click ..... End Sub -------------------------------------- How to determine which menuItem is clicked? Thanks.

      R Offline
      R Offline
      Rob Graham
      wrote on last edited by
      #2

      cast the first parameter to a menuitem, if the cast succeeds, check its name property... Absolute faith corrupts as absolutely as absolute power Eric Hoffer The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not. Eric Hoffer

      A 1 Reply Last reply
      0
      • R Rob Graham

        cast the first parameter to a menuitem, if the cast succeeds, check its name property... Absolute faith corrupts as absolutely as absolute power Eric Hoffer The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not. Eric Hoffer

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Thank you so much!

        1 Reply Last reply
        0
        • A Anonymous

          In the following code: ------------------------------------- Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click, MenuItem2.Click, MenuItem3.Click ..... End Sub -------------------------------------- How to determine which menuItem is clicked? Thanks.

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          what does sender evoke to you ?


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          R 1 Reply Last reply
          0
          • T toxcct

            what does sender evoke to you ?


            TOXCCT >>> GEII power
            [toxcct][VisualCalc]

            R Offline
            R Offline
            rswipe
            wrote on last edited by
            #5

            try this: Dim ItemClicked as MenuItem ItemClicked=Ctype(sender,menutitem) the do IF statement or Case Select

            T 1 Reply Last reply
            0
            • R rswipe

              try this: Dim ItemClicked as MenuItem ItemClicked=Ctype(sender,menutitem) the do IF statement or Case Select

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              certainly, but you answered the wrong person... :zzz:


              TOXCCT >>> GEII power
              [toxcct][VisualCalc]

              X 1 Reply Last reply
              0
              • T toxcct

                certainly, but you answered the wrong person... :zzz:


                TOXCCT >>> GEII power
                [toxcct][VisualCalc]

                X Offline
                X Offline
                Xybex
                wrote on last edited by
                #7

                How about if sender is declared_menu_item ?

                T 1 Reply Last reply
                0
                • X Xybex

                  How about if sender is declared_menu_item ?

                  T Offline
                  T Offline
                  toxcct
                  wrote on last edited by
                  #8

                  cast it the same way... :(


                  TOXCCT >>> GEII power
                  [toxcct][VisualCalc]

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups