Form1.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace DllXqManager
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. private void button1_Click(object sender, EventArgs e)
  19. {
  20. panel2.Controls.Clear();
  21. int l = 30;
  22. int l1 = l + 1;
  23. long stime = DateTime.Now.Ticks;
  24. for (int i = 0; i < 30; i++)
  25. {
  26. for (int j = 0; j < 30; j++)
  27. {
  28. PictureBox aa = new PictureBox();
  29. aa.Size = new Size(l, l);
  30. aa.BackColor = Color.Red;
  31. aa.Location = new Point(i * l1, j * l1);
  32. panel2.Controls.Add(aa);
  33. }
  34. }
  35. long etime = DateTime.Now.Ticks;
  36. long diff = etime - stime;
  37. textBox1.Text = diff.ToString();
  38. }
  39. private void button2_Click(object sender, EventArgs e)
  40. {
  41. panel2.Controls.Clear();
  42. int l = 30;
  43. int l1 = l + 1;
  44. long stime = DateTime.Now.Ticks;
  45. for (int i = 0; i < 30; i++)
  46. {
  47. for (int j = 0; j < 30; j++)
  48. {
  49. TEntityControl aa = new TEntityControl(null);
  50. aa.BackColor = Color.Blue;
  51. aa.Size = new Size(l, l);
  52. aa.Location = new Point(i * l1, j * l1);
  53. panel2.Controls.Add(aa);
  54. }
  55. }
  56. long etime = DateTime.Now.Ticks;
  57. long diff = etime - stime;
  58. textBox1.Text = diff.ToString();
  59. }
  60. }
  61. }