cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Width for controls

Was wondering if it was feasible to have an auto width option similar to the auto height for some of the controls like a label or a text input box so that I can vary the width of the control according to the text in it according to some predefined conditions.

Status: New
Comments
Community Champion

This is already possible by making the Width property of the control a function.

For example you can make the Width property of Label1 as this:

20*Len(Label1.Text)

Please try it

Microsoft

Hi Meneghino,

 

Thank you. I had actually already tried this, but the issue is if there is no text available in say a text input box then the width would be 0. Also as in the case of auto height, was trying to check the possibility of avoiding formulae

Community Champion

Hi @ashwath12

Please try this:

If(Len(TextInput1.Text)=0, 20, 20*Len(TextInput1.Text))

With formulas you are much more in control of what happens.

Microsoft

Thanks a lot Meneghino.

Community Champion

You are welcome @ashwath12

Regular Visitor

Still, some letters are smaller then others, so the amount of letters is not always an accurate way to establish the width of a button. I would still very much prefer an 'autowidth'.

Regular Visitor

Yes, exactly that - since the width of letters are different, all you can do is guess at this. Would be much better to just be able to set the width to auto.

Super User

The AutoWidth for labels is something I am really looking forward to because it is the only way for us to create multilingual applications where labels are aside (like on a toolbar) and their individual length can vary a lot according to the language.

Anonymous
Not applicable

It's impossible to create tags visually without this.

Microsoft

Looking forward to see this feature on PA