It may be sometimes the case that you create controls via C# code. Especially when you create custom controls. Then you sometimes need the current control size. Well that is easy, may be thought.
Easily call control.DesiredSize.Width and control.DesiredSize.Height. The problem is that you will not get any values by calling Width and Height. This is because the control has not updated the value for the DesiredSize property.
One possible solution is to call the control.Mesure(someVeryBigSize). With that method you call the measurement procedure that calculates and updates the desired size of the control. As parameter you pass the size the control can allocate. If you want to know exactly the size of the control you want to call DesiredSize on you should consider to choose a very big size.
Only after that you have the possibility to retrieve a value for DesiredSize.Height and DesiredSize.Width.