|
-
Aug 25th, 2007, 06:54 AM
#1
Thread Starter
Just Married
[2005] Menu item in tree
Hi all
how to get menu item of menustrip in a tree view.
I want to make the tree as same as the menu if the menu strip has sub menu then it show sub pair in tree same for the sub,sub menu and so on
-
Jan 25th, 2008, 03:39 AM
#2
Lively Member
Re: [2005] Menu item in tree
Hai Sakthi
While Creating Menus Use all HelPContentID for usingCode or first 5 characters of name to mention
each Different menu a codein such a way that first 3 characters are its parent MenuCode and 3 is the code of that Menu
Save all Menuitems to a table while loading the project
Tree.Nodes.Clear
Tree.Nodes.Add , , "MENU10", "MENUS"
If Rs_Menu1.State <> 0 Then Rs_Menu1.Close
Rs_Menu1.Open "Select * from Menus where del_flag=false order by ParentMenu,MenuCode", dbSec, adOpenDynamic, adLockPessimistic
If Rs_Menu1.EOF = False Or Rs_Menu1.BOF = False Then
Rs_Menu1.MoveFirst
Do Until Rs_Menu1.EOF
If Rs_Menu1!ParentMenu = 10 Then
Tree.Nodes.Add "MENU10", tvwChild, "MENU" & Trim(Str(Rs_Menu1!MenuCode)), Rs_Menu1!MenuDesc
ElseIf Rs_Menu1!ParentMenu > 10 Then
Tree.Nodes.Add "MENU" & Trim(Val(Rs_Menu1!ParentMenu)), tvwChild, "MENU" & Trim(Str(Rs_Menu1!MenuCode)), Rs_Menu1!MenuDesc
End If
Rs_Menu1.MoveNext
Loop
End If
For i = 1 To Tree.Nodes.Count
Tree.Nodes(i).Expanded = True
Next
Use this my own code works well for me Pls send me any problem if u face
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|