fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. MyGroup _Btn = new MyGroup();
  19. private void Form1_Load(object sender, EventArgs e)
  20. {
  21. for (int i = 0; i < toolStrip1.Items.Count; i++)
  22. {
  23. if (toolStrip1.Items[i].GetType().ToString() ==
  24. "System.Windows.Forms.ToolStripButton")
  25. {
  26. _Btn.Items.Add(toolStrip1.Items[i]);
  27. }
  28. }
  29. _Btn.EnabledAll(false);
  30. }
  31. }
  32. public class MyGroup
  33. {
  34. public List<ToolStripItem> Items = new List<ToolStripItem>();
  35. public void EnabledAll(bool b)
  36. {
  37. foreach (ToolStripItem _Items in this.Items)
  38. {
  39. _Items.Enabled = b;
  40. }
  41. }
  42. }
  43.  
  44. }
  45.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty