关于DataGridView自定义控件列的有关问题
关于DataGridView自定义控件列的问题
请教个问题,现有自定义progressbar控件一枚,想在Datagridview中自定义一Dridprogress列,就是那一列全为自定义的progressbar控件,无从下手,求各位谁知道的指点下火知道哪有相关问题的发下链接附带自定义的空间代码,也是在CSDN找到的
请教个问题,现有自定义progressbar控件一枚,想在Datagridview中自定义一Dridprogress列,就是那一列全为自定义的progressbar控件,无从下手,求各位谁知道的指点下火知道哪有相关问题的发下链接附带自定义的空间代码,也是在CSDN找到的
using System;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.ComponentModel.Design;
using System.Windows.Forms.Design;
namespace CSUST.Data
{
[ToolboxItem(true)]
[ToolboxBitmap(typeof(System.Windows.Forms.ProgressBar))]
[Designer(typeof(TSmartProgressBarDesinger),typeof(IDesigner))]
public class TSmartProgressBar : Label
{
private const int m_MaxBarWidth = 20;
private const int m_MaxBarSpace = 10;
private int m_Value = 0;
private int m_Maximum = 100;
private int m_ProgressBarBlockWidth = 6;
private int m_ProgressBarBlockSpace = 1;
private bool m_ProgressBarPercent = true;
private bool m_ProgressBarMarginOffset = true;
private TProgressBarBorderStyle m_ProgressBarBorderStyle = TProgressBarBorderStyle.Flat;
private SolidBrush m_ProgressBarFillBrush;
public TSmartProgressBar()
{
m_ProgressBarFillBrush = new SolidBrush(Color.Coral);
base.BackColor = Color.White;
base.ForeColor = Color.Blue;
base.AutoSize = false; // AutoSize is Designer Attribute
base.TextAlign = ContentAlignment.MiddleCenter; // TextAlign is Designer Attribute
}
protected override void Dispose(bool disposing)
{
try
{
if (disposing)
{
// release managed resource
}
m_ProgressBarFillBrush.Dispose(); // release unmanaged resource
}
finally
{
base.Dispose(disposing);
}
}
#region custom or modified properties
[Category("Custom")]
[Description("Set/Get progress bar fill color.")]
[DefaultValue(typeof(Color), "Coral")]
public Color ProgressBarFillColor
{
get
{
return m_ProgressBarFillBrush.Color;
}
set
{
if (m_ProgressBarFillBrush.Color != value)
{
m_ProgressBarFillBrush.Color = value;
this.Invalidate();