Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change colour of ToolStrip DropDown arrow?

Tags:

c#

toolstrip

In my Winforms application I have a toolstrip which I set it's BackColor property to Black. All is good except the fact that every drop-down button on the toolbar draws its drop down arrow in black, thus makeing it invisible. My question is, how do I change the colour of this arrow? I looked for something useful in the toolstrip renderer but all I could found was ToolStripDropDownBackground. So, how do I make it white, for example? Thanks

like image 597
Valentin Radu Avatar asked Feb 13 '23 23:02

Valentin Radu


1 Answers

Create your own renderer:

public class MyRenderer : ToolStripRenderer {

  protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) {
    e.ArrowColor = Color.White;
    base.OnRenderArrow(e);
  }

}

To use it, set your ToolStrip control:

toolStrip1.Renderer = new MyRenderer();
like image 66
LarsTech Avatar answered Feb 27 '23 03:02

LarsTech