I implemented a custom DateTimePicker. On the DateTimePicker there is a button. In the examples I've found it's width is set to 16. This is working but I would like to have a dynamic approach.
So, is there a way to get the size of this button or is there a general way to get information about .Net-Control sub elements like size etc.?
Trying DateTimePicker.Controls didn't help me (it's empty).
Most all Win32 arrow buttons key off the scroll bar metric:
You want SystemInformation.VerticalScrollBarArrowHeight
Two helpful classes: SystemInformation and ControlPaint. When dealing with custom controls they can be invaluable.
Int32 size = SystemInformation.VerticalScrollBarArrowHeight;
ControlPaint.DrawScrollButton(e.Graphics, 0, 0, size, size, ScrollButton.Down, ButtonState.Normal);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With