其实很简单,自定义一个类让该类继承自Panel类,设置相关的值即可,代码如下: 
  /// <summary> /// 游戏面板 用于重绘时不闪烁 /// </summary> class GamePanel:Panel { public GamePanel() { SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); } }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2021-08-08
  • 2022-01-08
  • 2021-08-19
猜你喜欢
  • 2021-11-06
  • 2021-06-30
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案