自定义控件 部分代吗 ArrayList points;//使用大小可按需动态增加的数组实现 IList 接口 Point currentPoint; Pen thepen;//定义用于绘制直线和曲线的对象。 SolidBrush thebrush; public int [,] vt={{20,0},{30,0},{60,0}}; ArrayList vlps=new ArrayList (); public string [] input={"一月","二月","三月"}; public int ja; public int jb; public int a=3; public int b=1; public int c; public int n=1; public string name1; for(int j=0;j<a;j++) { vlps.Clear (); for (int i=0;i<b;i++) { if(b>1 ) {
[Description("该项以数据行作为分组依据,当其为分组依据时,getcounts只能为1")] public int getrows { get { return a; } set { a=value; } } [Description("该项以数据列作为分组依据,当其为分组依据时,getrows只能为1")] public int getcounts { get { return b; } set { b=value; } } [Description("确定要取得的数据列或数据行,最小值取1,最大值以分组依据与数组维数有关")] public int getonenumber { get { return n; } set { n=value; } } [Description("获取数据")] public int[,] getallnumber { get { return vt; } set { vt=value; } } [Description("确定分组名称")] public string [] getname { get { return input; } set { input=value; }
} [Description("表名")] public string name { get { return name1; } set { name1=value; } } } }
部分代吗
ArrayList points;//使用大小可按需动态增加的数组实现 IList 接口
Point currentPoint;
Pen thepen;//定义用于绘制直线和曲线的对象。
SolidBrush thebrush;
public int [,] vt={{20,0},{30,0},{60,0}};
ArrayList vlps=new ArrayList ();
public string [] input={"一月","二月","三月"};
public int ja;
public int jb;
public int a=3;
public int b=1;
public int c;
public int n=1;
public string name1;
for(int j=0;j<a;j++)
{
vlps.Clear ();
for (int i=0;i<b;i++)
{
if(b>1 )
{
j=n-1;
currentPoint=new Point(50+5*(i+1)+(30-c)*i,190-vt[j,i]);//确定矩形的左上角座标
points.Add (currentPoint);
}
if(a>1)
{
i=n-1;
currentPoint=new Point(50+5*(j+1)+(30-c)*j,190-vt[j,i]);//确定矩形的左上角座标
points.Add (currentPoint);
}
if(a==1 && b==1)
{
currentPoint=new Point(50+5*(i+1)+(30-c)*i,190-vt[j,i]);//确定矩形的左上角座标
points.Add (currentPoint);
}
} }
{
myCol=MyCol[i];
thebrush=new SolidBrush (myCol);
if(a>1)
{
jb=n-1;
ja=i;
}
if(b>1)
{
ja=n-1;
jb=i;
}
if(a==1 && b==1)
{
ja=a-1;
jb=i;
}
g.FillRectangle(thebrush,mypoint[17+i].X,mypoint[17+i].Y,30-c,vt[ja,jb]);
g.FillRectangle (thebrush,mypoint[17+i+c].X ,mypoint[17+c+i].Y ,12,8);
g.DrawString ( input[i],new Font ("宋体",8),new SolidBrush (Color.Black ),mypoint[17+c+i].X+10,mypoint[17+c+i].Y);
g.DrawString(input[i],new Font("宋体",8),new SolidBrush (Color.Black),mypoint[17+i].X -5,190);
}
int l=int.Parse (Math.Ceiling(c/2).ToString ());
for(int i=0;i<c-Math.Ceiling(c/2);i++)
{
myCol=MyCol[i+l];
thebrush=new SolidBrush (myCol);
if(a>1)
{
jb=n-1;
ja=i+l;
}
if(b>1)
{
ja=n-1;
jb=i+l;
}
if(a==1 && b==1)
{
ja=a-1;
jb=i;
}
g.FillRectangle(thebrush,mypoint[l+17+i].X ,mypoint[17+i+l].Y ,30-c,vt[ja,jb]);
g.FillRectangle (thebrush,mypoint[l+17+i+c].X ,mypoint[l+17+c+i].Y ,12,8);
g.DrawString ( input[i+l] ,new Font ("宋体",8),new SolidBrush (Color.Black ),mypoint[l+17+i+c].X+10,mypoint[l+17+i+c].Y);
g.DrawString(input[i+l],new Font("宋体",8),new SolidBrush (Color.Black),mypoint[17+i+l].X -5,190);
}
}
public int getrows
{
get
{
return a;
}
set
{
a=value;
} }
[Description("该项以数据列作为分组依据,当其为分组依据时,getrows只能为1")]
public int getcounts
{
get
{
return b;
}
set
{
b=value;
}
}
[Description("确定要取得的数据列或数据行,最小值取1,最大值以分组依据与数组维数有关")]
public int getonenumber
{
get
{
return n;
}
set
{
n=value;
}
}
[Description("获取数据")]
public int[,] getallnumber
{
get
{
return vt;
}
set
{
vt=value;
}
}
[Description("确定分组名称")]
public string [] getname
{
get
{
return input;
}
set
{
input=value;
}
}
[Description("表名")]
public string name
{
get
{
return name1;
}
set
{
name1=value;
}
} }
}