主题:请问,控件的refresh重画问题
我在使用label控件和button控件的时候,想用button空间调用label的重画,郁闷的是怎么都重画不了,不知道是怎么回事,我知道是用refresh()方法,请问能帮个忙说具体点么?
比如说:
private void labGround_Paint(object sender, PaintEventArgs e)
{
int i, j;
Brick brk=new Brick();
Graphics gp = e.Graphics;
SolidBrush brush = new SolidBrush(Color.Beige);
//重绘全场
for (i = 0; i < 10; i++)
{
for (j = 0; j < 20; j++)
{
if (brk.Ground[i, j] != 0)
gp.FillRectangle(brush, i * 20, j * 20, 20, 20);
}
}
}
怎么在一个button里面重绘?
麻烦了,谢谢~我用的比如简单的……
private void btnStart_Click(object sender, EventArgs e)
{
int i, j;
Brick brk = new Brick();
for (i = 0; i < 10; i++)
{
for (j = 0; j < 20; j++)
{ brk.Ground[i, j] = 1; }
}
labGround.Update();
labGround.Refresh(); <===这三种里面怎么一种都没用啊~?
labGround.Invalidate(); 我都郁闷死了!
}
各位大哥帮帮忙~~
比如说:
private void labGround_Paint(object sender, PaintEventArgs e)
{
int i, j;
Brick brk=new Brick();
Graphics gp = e.Graphics;
SolidBrush brush = new SolidBrush(Color.Beige);
//重绘全场
for (i = 0; i < 10; i++)
{
for (j = 0; j < 20; j++)
{
if (brk.Ground[i, j] != 0)
gp.FillRectangle(brush, i * 20, j * 20, 20, 20);
}
}
}
怎么在一个button里面重绘?
麻烦了,谢谢~我用的比如简单的……
private void btnStart_Click(object sender, EventArgs e)
{
int i, j;
Brick brk = new Brick();
for (i = 0; i < 10; i++)
{
for (j = 0; j < 20; j++)
{ brk.Ground[i, j] = 1; }
}
labGround.Update();
labGround.Refresh(); <===这三种里面怎么一种都没用啊~?
labGround.Invalidate(); 我都郁闷死了!
}
各位大哥帮帮忙~~