Set VisualElement's % based position with c#

I cant figure out how can i set % based position with c# as in the UI Toolkit window. Any idea?
8971558--1233463--upload_2023-4-25_10-6-20.png

You create percentage using
style.width = Length.Percent(100);

There is an implicit cast to a length as pixels when you assign a number to a styleLength, so you need to be explicit by using Length.Percent or by using the constructor with the unit specified to have a percentage.

1 Like

Thank you so much <3