展开全部
如果是web变成那就用table好了;
WINFORM就用个按钮e68a843231313335323631343130323136353331333264653461事件吧,在Panel上绘制的。
private void button1_Click(object sender, EventArgs e)
{
int pX = panel1.Width;
int pY = panel1.Height;
Graphics MyGraphics = panel1.CreateGraphics();
Pen pen = new Pen(Color.Red, 1f);
//绘制列
int x = 0;
for (int m = 0; m
{
MyGraphics.DrawLine(pen, x, 0, x, pY);
x += pX / 4;
}
//绘制行
int y = 0;
for (int n = 0; n
{
MyGraphics.DrawLine(pen, 0, y, pX, y);
y += pY / 10;
}
}