You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB
C#

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.Tabs
{
[ToolboxItem(false)]
public partial class BaseTabItem : UserControl
{
protected NLog.Logger LOGGER = null;
public BaseTabItem()
{
InitializeComponent();
//减少闪烁
SetStyles();
//加载日志
LOGGER = NLog.LogManager.GetLogger(GetType().FullName);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (this.DesignMode) return;
}
#region 减少闪烁
private void SetStyles()
{
SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer |
ControlStyles.ResizeRedraw |
ControlStyles.DoubleBuffer , true);
//强制分配样式重新应用到控件上
UpdateStyles();
base.AutoScaleMode = AutoScaleMode.None;
}
#endregion
}
}