InvokePaintBackground( );使用
请问InvokePaintBackground( ); 的参数应该怎么写
功能是为了实现 窗口颜色的渐变
private void button2_Click(object sender, EventArgs e){InvokePaintBackground( );this.Hide( );this.Visible=true;}protected override void OnPaintBackground(PaintEventArgs e) { int y, dy; y = this.ClientRectangle.Location.Y; dy = this.ClientRectangle.Height / 256; for (int i = 255; i >= 0; i--) { Color c = new Color(); c = Color.FromArgb(Convert.ToInt32(textBox1.Text.ToString()), i, Convert.ToInt32(textBox2.Text.ToString())); SolidBrush sb = new SolidBrush(c); Pen p = new Pen(sb, 1); e.Graphics.DrawRectangle(p, this.ClientRectangle.X, y, this.Width, y + dy); y = y + dy; } }