49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			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();
 | |
|         }
 | |
|     }
 | |
| }
 | 
