0

hi
i need to create menu with icons from xml file, icons from url

xml look like this

- <Item name="cat" ico="http://....../cat.bmp">
  </Item>
- <Item name="dog" ico="http://....../dog.bmp">
  </Item>
- <Item name="cow" ico="http://....../cow.bmp">
  </Item>

my c# code is

XmlDocument doc = new XmlDocument();
            doc.Load("katalogs.xml");


            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {

                ToolStripMenuItem childMenu = new ToolStripMenuItem(node.Attributes["name"].Value, new Bitmap(cow.bmp")));
                tools.DropDownItems.Add(childMenu);
            }

if i set icon from file, all working fine
but have can i get icon from url?
Thanks a lot

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Ramy Mahrous
0

ok, with icons done, but now i have new problem
i add new atribute "targetUrl" in xml doc
how can i add click events dynamicly? if i click on menu item, opens targeturl in new browser window?

0
//Here you create new MenuItem
//Here you play with some MenuItem properties 
MenuItem.Click+=new System.EventHandler(this.AnyMenuItem_Click);
private void AnyMenuItem_Click(object sender, System.EventArgs e)
{
// your code to get the URL and open it
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.