Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 785
Haider Ali Wajihi Avatar asked Jan 10 '14 07:01

Haider Ali Wajihi


1 Answers

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

  using System.Windows.Forms;

  ...

  int arrowWidth = SystemInformation.VerticalScrollBarWidth;
like image 59
Dmitry Bychenko Avatar answered Sep 24 '22 17:09

Dmitry Bychenko