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. Office-like menu...

Office-like menu...

Scheduled Pinned Locked Moved Visual Basic
question
5 Posts 3 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
    Agus Budianto
    wrote on last edited by
    #1

    can we add icon to mainmenu control in windows form? how? thanks. is there a sub or function like "mainmenu.items(x).icon=(filename)... :laugh:"

    T G 2 Replies Last reply
    0
    • A Agus Budianto

      can we add icon to mainmenu control in windows form? how? thanks. is there a sub or function like "mainmenu.items(x).icon=(filename)... :laugh:"

      T Offline
      T Offline
      The ANZAC
      wrote on last edited by
      #2

      When you sy main menu, are you referring to a menustrip that you have placed on the form. Posted by The ANZAC

      A 1 Reply Last reply
      0
      • A Agus Budianto

        can we add icon to mainmenu control in windows form? how? thanks. is there a sub or function like "mainmenu.items(x).icon=(filename)... :laugh:"

        G Offline
        G Offline
        giddy_guitarist
        wrote on last edited by
        #3

        i dont know about VB.NET.But in VB6 you need to use this API function: Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long This is how you use it in VB6 _Get the handle of the form's menu hMenu = GetMenu(Me.hWnd) 'Get the handle of the form's submenu hSubMenu = GetSubMenu(hMenu, 0) 'Change first item (index=0) picBitmaps(0).Picture = picBitmaps(0).Image lngID = GetMenuItemID(hSubMenu, 0) Call ModifyMenu(hMenu, lngID, MF_BITMAP, lngID, CLng(picBitmaps(0).Picture))_ i heard VB.NET has some API inbuilt.So look it up OK! hope i helped Gideon:laugh:

        A 1 Reply Last reply
        0
        • T The ANZAC

          When you sy main menu, are you referring to a menustrip that you have placed on the form. Posted by The ANZAC

          A Offline
          A Offline
          Agus Budianto
          wrote on last edited by
          #4

          yes, i am.. i dont know how to add icon to it.

          1 Reply Last reply
          0
          • G giddy_guitarist

            i dont know about VB.NET.But in VB6 you need to use this API function: Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long This is how you use it in VB6 _Get the handle of the form's menu hMenu = GetMenu(Me.hWnd) 'Get the handle of the form's submenu hSubMenu = GetSubMenu(hMenu, 0) 'Change first item (index=0) picBitmaps(0).Picture = picBitmaps(0).Image lngID = GetMenuItemID(hSubMenu, 0) Call ModifyMenu(hMenu, lngID, MF_BITMAP, lngID, CLng(picBitmaps(0).Picture))_ i heard VB.NET has some API inbuilt.So look it up OK! hope i helped Gideon:laugh:

            A Offline
            A Offline
            Agus Budianto
            wrote on last edited by
            #5

            ok, i will try it out, thankz for the info.. ;) Ghost

            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