Afshin_Zavar Level: Professor

 Registered: 17-07-2003 Posts: 84
|
make tree view of all menues on the form
this is a simple code which i made to get list of all menus and sub-menus of Form
Now i wanna add each name of MenuItem to TreeView to show tree-style of menu.
can anybody make it possible?
TraceToolStripItem( menuStrip1.Items );
/********************/
private void TraceToolStripItem( ToolStripItemCollection menus )
{
ToolStripMenuItem t = new ToolStripMenuItem();
foreach ( ToolStripItem c in menus )
{
if ( c is ToolStripMenuItem )
{
t = (ToolStripMenuItem) c;
// checkedListBox1.Items.Add( t.Text );
TraceToolStripItem( t.DropDownItems );
}
}
}
|
____________________________
Persia
|