How to set translate.x and scale.x values in c# for UI Toolkit Button class

I manually change these values here for Translate.x = -12 and Scale.x = 1.1 and it works great in the UI.

8998267--1239505--UIBuilderSnip.png

However, I would like to change these values in code/c#. I have tried the following and getting all sorts of data type mismatch. Sorry for such a basic question as im sure there is an easy way to do this - just starting to learn UI Toolkiit Thanks! Chat GPT is referencing extremely old documentation and hasn’t been able to help here as much as i would expect…
(BTW, i have all the code plumbed to where i can get access to the button that i need to reference and that all works, i just am not having any luck changing the values i need).

_sheetHolder_Button = panel.Query<Button>("Button").First();

_sheetHolder_Button.style.translate.value.x = -12;
_sheetHolder_Button.style.left = -12;
_sheetHolder_Button.style.scale.value.x = 1.2;
_sheetHolder_Button.style.left = new StyleLength(-12);

I’m an idiot - did more digging in the forums. Sorry for wasted forum space (i cant find a way to delete the thread).
Solved it as so:

_sheetHolder_Button.style.scale = new Scale(new Vector3(1.1f, 1.0f,1.0f));
_sheetHolder_Button.style.translate = new Translate(-12, 0, 0);
3 Likes