Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
addmenu subitems at runtime, no api calls needed
Author:
docsery
Submitted:
11/18/2018
Version:
VB6
Compatibility:
VB6
Category:
Miscellaneous
Views:
5761
This simple program adds menu items or subitems at runtime without any api calls
Declarations:
'none
Code:
put a label on the form, in the menu editor add a menu item call it FileMenu with an index of 0, then add a subitem call it FileMenu1 with an index of 0 To add new menus add them as FileMenu(**) To add subitems add them as FileMenu1(**) Change the names to suit Private Sub FileMenu1_Click(Index As Integer) Select Case Index Case Index Label1.Caption = Index End Select End Sub Private Sub Form_Load() Dim x As Integer For x = 1 To 4 Load FileMenu1(x) FileMenu1(x).Caption = "Menu " & x + 1 FileMenu1(x).Visible = True Next x End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement