Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int x = 0; x < this.imageListToolbar3small.Images.Count; ++x)
- {
- Image temp = this.imageListToolbar.Images[x];
- temp.Save(this.imageListToolbar.Images.Keys[x] + ".png");
- }
- foreach (ToolBarButton b in toolBar.Buttons)
- {
- //can be negative, for separators, because separators don't have images
- if (b.ImageIndex >= 0)
- {
- Image i = toolBar.ImageList.Images[b.ImageIndex];
- i.Save(b.ImageIndex + ".png");
- }
- }
- Dim cntrl = New TheClassWithThePrivateImageList
- Dim pi As Reflection.PropertyInfo, iml As System.Windows.Forms.ImageList, propName = "ThePropertyName"
- pi = cntrl.GetType.GetProperty(propName, Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance)
- iml = CType(pi.GetValue(cntrl), System.Windows.Forms.ImageList)
- For Each key In iml.Images.Keys
- Dim image As Drawing.Image = iml.Images.Item(key)
- image.Save($"{propName}_{key}")
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement