I
I
Ivan2020-03-03 03:46:04
WPF
Ivan, 2020-03-03 03:46:04

How to center horizontally and vertically the contents of the Text property of a TextBlock element in WPF?

I looked in the properties of the TextBlock element, I found only TextAlign there, it aligns only vertically, I don’t understand WPF well, maybe this alignment is not needed from the point of view of common sense, and is there an alternative?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LiptonOlolo, 2020-03-03
@Vamba45

HorizontalAlignment="Center"
VerticalAlignment="Center"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question