VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code add icons in the menu of your program Without any API. or Declarations less than 10 lines

by bader (7 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 8th February 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code add icons in the menu of your program Without any API. or Declarations less than 10 lines of code, very simple but very good effect.

Rate This code add icons in the menu of your program Without any API. or Declarations less than 10 lines



'following:
Option Explicit
Dim WithEvents MyMenu As IcoMenu

Private Sub Form_Load()
    
    Set MyMenu = New IcoMenu
    
    With MyMenu
        .SetItem 0, "New", Image1(0).Picture
        .SetItem 1, "Open ...", Image1(1).Picture
        .SetItem 2, "Save", Image1(2).Picture
        .SetItem 3, "Save as ..."
        .SetItem 4, "Exit", Image1(3).Picture, "exit"
    End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
    MyMenu.DestroyMenu
End Sub
Private Sub MNFile_Click()
    MyMenu.ShowMenu Form1.Left + 30, Form1.Top + Form1.Height - form1.ScaleHeight
End Sub




Download this snippet    Add to My Saved Code

This code add icons in the menu of your program Without any API. or Declarations less than 10 lines Comments

No comments have been posted about This code add icons in the menu of your program Without any API. or Declarations less than 10 lines. Why not be the first to post a comment about This code add icons in the menu of your program Without any API. or Declarations less than 10 lines.

Post your comment

Subject:
Message:
0/1000 characters