Files
Groupware/SubProject/FPJ0000/GantChart.cs
2022-02-01 00:28:56 +09:00

49 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FPJ0000
{
public partial class GantChart : Control
{
public GantChart()
{
InitializeComponent();
// Set Optimized Double Buffer to reduce flickering
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
// Redraw when resized
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.Resize += arLabel_Resize;
}
protected override void OnPaint(PaintEventArgs e)
{
//base.OnPaint(e);
//Set Optimized Double Buffer to reduce flickering
e.Graphics.CompositingQuality = CompositingQuality.HighQuality;
e.Graphics.InterpolationMode = InterpolationMode.High;
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
e.Graphics.FillRectangle(new SolidBrush(this.BackColor), DisplayRectangle);
}
void arLabel_Resize(object sender, EventArgs e)
{
Invalidate();
}
}
}