NewPanel.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 ProjectBase.Controls
  11. {
  12. public partial class NewPanel : Panel
  13. {
  14. public NewPanel()
  15. {
  16. InitializeComponent();
  17. this.DoubleBuffered = true;
  18. SetStyle(ControlStyles.UserPaint, true);
  19. SetStyle(ControlStyles.AllPaintingInWmPaint, true);
  20. SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
  21. }
  22. public NewPanel(IContainer container)
  23. {
  24. container.Add(this);
  25. InitializeComponent();
  26. this.DoubleBuffered = true;
  27. SetStyle(ControlStyles.UserPaint,true);
  28. SetStyle(ControlStyles.AllPaintingInWmPaint,true);
  29. SetStyle(ControlStyles.OptimizedDoubleBuffer,true);
  30. }
  31. protected override void OnPaint(PaintEventArgs pe)
  32. {
  33. base.OnPaint(pe);
  34. }
  35. }
  36. }