using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace POSV { public partial class AbstractTemplate : UserControl { private NLog.Logger logger = null; public AbstractTemplate() { InitializeComponent(); SetStyles(); logger = NLog.LogManager.GetLogger(GetType().FullName); } #region 减少闪烁 private void SetStyles() { SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer , true); //强制分配样式重新应用到控件上 UpdateStyles(); base.AutoScaleMode = AutoScaleMode.None; } #endregion protected NLog.Logger LOGGER { get { return logger; } } } }