Get WPF control height when it is set to Auto.

I need to get WPF control height to calculate my upper top control field, but when I try to get control height using textbox1.height , it returns β€œAuto”, not number

What can I do to get the control height when it is set to "Auto"?

+4
source share
1 answer

You should try the following:

 textBox1.ActualHeight 

Notes (by @Viv)

just make sure that when you request textBox1.ActualHeight, you do this when the control is Loaded. You will get 0.0 if you check ActualHeight before it is configured correctly

+6
source

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


All Articles