问题一:
       有这个方法吗?DrawXAxis()
问题二:
       这段代码怎么运行后没有反应??
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Data;
using System.Windows.Forms;namespace ptl
{
/// <summary>
/// UserControl1 的摘要说明。
/// </summary>
public class ptl : System.Windows.Forms.UserControl
{  public Point pt1=new Point(0,0);
public Pen pen1=new Pen(Color.Red,2);
public Pen zb=new Pen(Color.Blue,1);
public int n;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null; public ptl()
{ // 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent(); // TODO: 在 InitComponent 调用后添加任何初始化 } /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
components.Dispose();
}
base.Dispose( disposing );
}
public int nn
{
get
{
return n;
}
set
{
n=value;
Invalidate();
}
}
public Point ptl1
{
get
{
return pt1;
}
set
{
pt1=value;
Invalidate();
}
} #region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器 
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
// 
// ptl
// 
this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.Name = "ptl";
this.Size = new System.Drawing.Size(312, 304);
this.Load += new System.EventHandler(this.UserControl1_Load); }
#endregion protected override void OnPaintBackground(PaintEventArgs e)
{
Graphics g=this.CreateGraphics();
Rectangle rect=this.ClientRectangle;
Point pt=new Point(rect.X,rect.Y-rect.Height);
Point epx=new Point(rect.X+rect.Width,rect.Y-rect.Height);
Point epy=new Point(rect.X,rect.Y);
zb.EndCap=LineCap.ArrowAnchor;
g.DrawLine(zb,pt,epx);
g.DrawLine(zb,pt,epy);
Matrix mat=new Matrix(1, 0, 0, -1, 0, 0);
            g.Transform=mat;
g.TranslateTransform(rect.Width ,-rect.Height);
/*zb.DashStyle=DashStyle.DashDot;
int a,b,c;
            c=10;
a=rect.X/c;
b=rect.Y/c;
for(int i=1;i<nn;i++)
{
               g.DrawLine(zb,rect.X+i*a,rect.Y ,rect.X+i*a,rect.Y+rect.Height);
   g.DrawLine(zb,rect.X,rect.Y+i*a,rect.X+rect.Width,rect.Y+i*a);

}*/

}
private void UserControl1_Load(object sender, System.EventArgs e)
{

}
}
}