Editing UIElements Label through code and alignment

Is there a way I can shorten the width of the label on this UIElement IntegerField through code, or would I need to use USS? Also, I’d like to increase the size of the input field to a fixed width.

176562-inputfield.png

176563-inputfield2.png

Yes. That would probably be something like this:

var integerField = new UnityEditor.UIElements.IntegerField();

// increase the size of the input field to a fixed width:
int fixedWidth = 100;
integerField.style.maxWidth = fixedWidth;
integerField.style.minWidth = fixedWidth;

// shorten the width of the label:
foreach( var ve in integerField.Children() )
	if( ve is UnityEngine.UIElements.Label )
		ve.style.maxWidth = 30;