11-11-2012, 09:40 AM
Well that should be a simple problem to solve. If you used the code above without changing anything then the new buttons have no text or image and that's why you cannot see them but they are there just hover with the mouse over the toolstrip and you will see
To solve this just add another atribute to the xml file like this
Then set the value for the buton's text property inside the for loop
[code2=vbnet]For Each node In xml_doc.selectnodes("/root/ToolStrpButtons/item") 'the path of the xml child node
Dim btn As New ToolStripButton _
With {.Name = node.Attributes("name").Value.ToString, _
.Tag = node.Attributes("url").Value.ToString, _
.text = node.Attributes("text").Value.ToString}
AddHandler Button.Click, AddressOf TSButtonClick
Next[/code2]
Now the butons should be visible
To solve this just add another atribute to the xml file like this
Code:
<item name="btn" url="some Url" text="buton text">
Then set the value for the buton's text property inside the for loop
[code2=vbnet]For Each node In xml_doc.selectnodes("/root/ToolStrpButtons/item") 'the path of the xml child node
Dim btn As New ToolStripButton _
With {.Name = node.Attributes("name").Value.ToString, _
.Tag = node.Attributes("url").Value.ToString, _
.text = node.Attributes("text").Value.ToString}
AddHandler Button.Click, AddressOf TSButtonClick
Next[/code2]
Now the butons should be visible
Sssssssssoftware developer...