Good Day !
Is it possible to list down Form Menu name in ListView?
Example:
- Assuming that the word listed below are MDIForm Menus.
File (mnuFile)
..... Open (mnuOpen)
..... New (mnuNew)
..... Save (mnuSave)
Insert (mnuInsert)
..... Picture(mnuPicture)
..... Shapes (mnuShapes)
- Items in ListView:
mnuFile
mnuOpen
mnuNew
mnuSave
mnuInsert
mnuPicture
mnuShapes
Thanks !
VB6 Menus
Page 1 of 14 Replies - 400 Views - Last Post: 13 July 2012 - 04:11 PM
Replies To: VB6 Menus
#2
Re: VB6 Menus
Posted 10 July 2012 - 03:04 AM
I already get it !
xD
BTW, heres my code ..
xD
BTW, heres my code ..
Dim mc As Variant
For Each mc In MDIForm1.Controls
If TypeName(mc) = "Menu" Then
If mc.Caption <> "-" Then
With ListView1
.ColumnHeaders.Clear
.ColumnHeaders.Add(, , "Menu Caption").Width = 3000
.ColumnHeaders.Add(, , "Menu Name").Width = 2000
With .listitems
With .Add(, , mc.Caption)
.ListSubItems.Add , , mc.Name
End With
End With
End With
End If
End If
Next
This post has been edited by BobRodes: 10 July 2012 - 11:36 AM
#3
Re: VB6 Menus
Posted 10 July 2012 - 11:38 AM
Nicely done! 
One little minor improvement. Variants are large variables, because they have to include information about what type of variable they are. It's a little more efficient to declare your mc variable as a Control type, so:
Dim mc as Control
You probably didn't know you could do that.
By the way, I edited your post to include code tags.
One little minor improvement. Variants are large variables, because they have to include information about what type of variable they are. It's a little more efficient to declare your mc variable as a Control type, so:
Dim mc as Control
You probably didn't know you could do that.
By the way, I edited your post to include code tags.
#4
Re: VB6 Menus
Posted 12 July 2012 - 07:13 PM
Thank you BobRodes for replying to all my posts.
You always giving me a lot of information to improve my programming skills.
You always giving me a lot of information to improve my programming skills.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|