Painting a button
-
Iam trying to paint a button to get a shade in a button. Iam using a LinearGradientBrush. The code below Worked but it is taking away the button1.text also.How do i get the text to show after the button is painted. void button1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Rectangle rcView = this.ClientRectangle; using (LinearGradientBrush brush = new LinearGradientBrush(rcView, this.ColorStart, this.ColorEnd, this.GradientMode)) { g.FillRectangle(brush, rcView); } base.OnPaint(e); } ColorStart and ColorEnd are basically colors. Iam trying shade of the color from lighter to darker across the button. So my ColorStart is a little lighter color and ColorEnd is a Darker color. Thanks Kal
-
Iam trying to paint a button to get a shade in a button. Iam using a LinearGradientBrush. The code below Worked but it is taking away the button1.text also.How do i get the text to show after the button is painted. void button1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Rectangle rcView = this.ClientRectangle; using (LinearGradientBrush brush = new LinearGradientBrush(rcView, this.ColorStart, this.ColorEnd, this.GradientMode)) { g.FillRectangle(brush, rcView); } base.OnPaint(e); } ColorStart and ColorEnd are basically colors. Iam trying shade of the color from lighter to darker across the button. So my ColorStart is a little lighter color and ColorEnd is a Darker color. Thanks Kal
-
Iam trying to paint a button to get a shade in a button. Iam using a LinearGradientBrush. The code below Worked but it is taking away the button1.text also.How do i get the text to show after the button is painted. void button1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Rectangle rcView = this.ClientRectangle; using (LinearGradientBrush brush = new LinearGradientBrush(rcView, this.ColorStart, this.ColorEnd, this.GradientMode)) { g.FillRectangle(brush, rcView); } base.OnPaint(e); } ColorStart and ColorEnd are basically colors. Iam trying shade of the color from lighter to darker across the button. So my ColorStart is a little lighter color and ColorEnd is a Darker color. Thanks Kal
Reposting your question 3 hours apart in the same forum is consedered very rude!!! Don't do that again, and review my answer to your previous post
-
Reposting your question 3 hours apart in the same forum is consedered very rude!!! Don't do that again, and review my answer to your previous post
It's happening a lot at the moment. I assume it means 'I don't understand the answer, and am hoping for one I can copy and paste'
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog