Haider Ali
Haider Ali

Reputation: 2795

How to get "drop down button" size of ComboBox in C# winforms

How can I get the size of the DropDown Button on a ComboBox?

For anyone unsure of what I mean, it is the Button usually found on the right hand side of a ComboBox containing a downward facing arrow. When clicked this expands the DropDown section.

For further clarification, it is the button in the red circle in the below image.

enter image description here

Upvotes: 10

Views: 5662

Answers (1)

Dmitrii Bychenko
Dmitrii Bychenko

Reputation: 186668

For such constants you can use GetSystemMetrics API function; C# quick analogue is SystemInformation class:

  using System.Windows.Forms;

  ...

  int arrowWidth = SystemInformation.VerticalScrollBarWidth;

Upvotes: 15

Related Questions