Dynamically build cascading menu from directory structure

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Post Reply
User avatar
PGomersall
Posts: 92
Joined: Sun Mar 03, 2013 12:40 pm

Dynamically build cascading menu from directory structure

Post by PGomersall » Fri Nov 22, 2019 9:58 am

Hi at Sapien,
Have you any examples of dynamically building a cascading toolstripmenu from a simple directory tree (2\3 levels deep) and adding files within the tree as items with click events? Obviously given a set starting root folder.
I am trying to add this kind of structure to a system tray app.
Pete

jvierra
Posts: 14000
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Dynamically build cascading menu from directory structure

Post by jvierra » Fri Nov 22, 2019 10:41 am

For this kind of structure we would use a TreeView control. Doing this complex of a structure from a tray app would be disruptive. Just have the tray app open a dialog with a TreeView control.

Post Reply