M
M
Maxim Siomin2020-12-01 17:13:16
WPF
Maxim Siomin, 2020-12-01 17:13:16

How to position an element in wpf so that it is n% from the edge?

How to place an element in wpf (conditionally textblock) so that it is not n pixels from the edge, but n% (to work at any resolution)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rasse, 2020-12-01
@MaxSiominDev

Thickness t = label1.Margin;
t.Left = ......; // assign your value here
label1.Margin = t;
msdn.microsoft.com/en-us/library/system.windows.th...

R
Roman, 2020-12-02
@yarosroman

Use a binding and a converter that will convert the value into percentages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question