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. Cumstomizable Mainmenu: how to add the events C#s vs VB.NET

Cumstomizable Mainmenu: how to add the events C#s vs VB.NET

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studiocomtutorial
2 Posts 2 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.
  • D Offline
    D Offline
    David M J
    wrote on last edited by
    #1

    Hi, I am trying to convert the code in this document: http://www.codeproject.com/cs/miscctrl/custommenu.asp[^] into VB.net instead of C#. I have got most of it done but I am missing the final step, or at least I hope it is the final step. In the article all the menuitems have the following two events added: this.menuItem3.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.OnDrawItemSec); this.menuItem3.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.OnMeasureItemSec); When I look at the source article used for this article, the author writes about going to the eventtab on each menuitem. I am guessing this is typically C# as I cannot find it in VB.net. So can anyone please tell me how to do this? Thanks David J Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    R 1 Reply Last reply
    0
    • D David M J

      Hi, I am trying to convert the code in this document: http://www.codeproject.com/cs/miscctrl/custommenu.asp[^] into VB.net instead of C#. I have got most of it done but I am missing the final step, or at least I hope it is the final step. In the article all the menuitems have the following two events added: this.menuItem3.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.OnDrawItemSec); this.menuItem3.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.OnMeasureItemSec); When I look at the source article used for this article, the author writes about going to the eventtab on each menuitem. I am guessing this is typically C# as I cannot find it in VB.net. So can anyone please tell me how to do this? Thanks David J Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Your are looking for the AddHandler statement: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmAddHandlerStatement.asp For your example: AddHandler Me.menuItem3.DrawItem, AddressOf Me.OnDrawItemSec AddHandler Me.menuItem3.MeasureItem, AddressOf Me.OnMeasureItemSec

      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