Experts Exchange connects you with the people and services you need so you can get back to work.
Improve company productivity with a Business Account.Sign Up
this.BackColor = Color.Transparent;
Open in new window
private void panel1_Paint(object sender, PaintEventArgs e)
Control control = (Control)sender;
Graphics g = e.Graphics;
Color startColor = Color.FromArgb(106, 127, 156);
Color endColor = Color.FromArgb(177, 197, 218);
using (LinearGradientBrush darkBrush = new LinearGradientBrush(control.ClientRectangle, startColor, endColor, LinearGradientMode.Vertical))
There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
but in the panel I have a text box whose background color is shown in solid color. How can I make this text box color gradient too
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.