ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Bug ! Textbox on userform will not align text correctly ? (https://www.excelbanter.com/excel-programming/380721-bug-textbox-userform-will-not-align-text-correctly.html)

Grenier

Bug ! Textbox on userform will not align text correctly ?
 
I have several textbox control on a userform. Some are on the form and others
are on a multipage control. They are all set to align text to the left.

When the number of char exeed the width of the textbox (text too long to fit
in the textbox), the alignment become now to the right ! Even when the
userform loads for the first time.

Further more when I put focus on the multipage (click on a textbox on the
multipage) every textbox that have text too long to fit in the textbox change
automatically it's align property to the right.

Text is store on a sheet and is push back on the controls in the
UserForm_Initialize event like so: txt_name.Value = Cells(3, 2)

Anybody have seen this behavior or am I missing a property ??

Merci !
Jean-Francois Grenier.

Corey

Bug ! Textbox on userform will not align text correctly ?
 
You can align the text in a textbox or combobox through the properties:

TextAlignLeft
TextAlignCentre or
TextAlignRight

Change to suit

Corey...

"Grenier" wrote in message
...
I have several textbox control on a userform. Some are on the form and
others
are on a multipage control. They are all set to align text to the left.

When the number of char exeed the width of the textbox (text too long to
fit
in the textbox), the alignment become now to the right ! Even when the
userform loads for the first time.

Further more when I put focus on the multipage (click on a textbox on the
multipage) every textbox that have text too long to fit in the textbox
change
automatically it's align property to the right.

Text is store on a sheet and is push back on the controls in the
UserForm_Initialize event like so: txt_name.Value = Cells(3, 2)

Anybody have seen this behavior or am I missing a property ??

Merci !
Jean-Francois Grenier.




NickHK

Bug ! Textbox on userform will not align text correctly ?
 
You need to reset the txt_name.SelStart property to 0.

NickHK

"Grenier" wrote in message
...
I have several textbox control on a userform. Some are on the form and

others
are on a multipage control. They are all set to align text to the left.

When the number of char exeed the width of the textbox (text too long to

fit
in the textbox), the alignment become now to the right ! Even when the
userform loads for the first time.

Further more when I put focus on the multipage (click on a textbox on the
multipage) every textbox that have text too long to fit in the textbox

change
automatically it's align property to the right.

Text is store on a sheet and is push back on the controls in the
UserForm_Initialize event like so: txt_name.Value = Cells(3, 2)

Anybody have seen this behavior or am I missing a property ??

Merci !
Jean-Francois Grenier.





All times are GMT +1. The time now is 03:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com