I cant figure out how can i set % based position with c# as in the UI Toolkit window. Any idea?
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