110,535
社区成员
发帖
与我相关
我的任务
分享
public Form1()
{
InitializeComponent();
g = pictureBox1.CreateGraphics();
}
private Graphics g;
int x, y;
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
Point point = PointToClient(MousePosition);
x = point.X;
y = point.Y;
g.Clear(Color.White);
g.DrawLine(Pens.Black, 0, y, this.Width, y);
g.DrawLine(Pens.Black, x, 0, x, this.Height);
}