日期:2014-05-18 浏览次数:20908 次
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; } }