Tag Size Measurement

I am using a custom control with some shortcuts on it, and I need to measure the size of these labels in order to have an optimal layout. That way, I can correctly show the control for each font and font size.
Could you tell me how I can do this, please?
Thank.

+3
source share
2 answers

The right way to organize and organize your custom control according to the size of its sub-elements is to override MeasureOverride and ArrangeOverride .

. , ( MeasureOverride):

  • UIElement.Measure ( ), , ,
  • ( MeasureOverride).

, ArrangeOverride, , ,

  • ,
  • UIElement.Arrange .
+2

ev.Graphics.MeasureString(str, font)

0

Source: https://habr.com/ru/post/1738879/


All Articles