View Full Version : How to I tame TextArea
Jerry62712
11-19-2009, 09:30 PM
I have to change the text in various places on my form depending on the language selected. In Spanish the labels become very long. It is made even worse that you can also change the font size.
To solve this I switched Labels to TextAreas. Two problem or questions have resulted.
1) Is there a way to have a TextArea the size of its content? If there is one line of content it would be that tall. If there is two lines of content it is two lines tall.
2) Is there a way to eliminate the scroll bar when it becomes two lines tall and have the control grow taller? This problems comes mostly from changing the font size.
Barna Biro
11-19-2009, 10:16 PM
Hi there,
I'm not sure if I can visually imagine the situation correctly but I'm quite confident that using a TextArea is not a good solution. The Label for once resizez to it's content... if the text is too long and you want the label to be of fixed size, then set it's width to a fix value and the text will be truncated if the value is overlapped.
In case you want the text not to be truncated but moved to a new line or something, then instead, try using a Text control. You could also override the Label component and implement the desired functionality.
If you could post a screenshot or something so that we can clearly understand what you have now and what you want to achieve then I'm sure that we can come up with more exact solutions and more useful advices ( still, I'm quite sure that the TextArea is not the best solution ).
Best wishes,
Barni
Jerry62712
11-20-2009, 03:22 PM
Thanks for the reply. You are correct that we don't want the text to truncate. There would be no way to see the truncated text without using a mouse and we have to design so that people that don't have mice will still work.
I tested the Text and found that it will automatically word wrap, but you have to explicitely set the sized for the content. That means for every field I would have to have code to change the sizes so the label will all fit in Text control. As the content changes depending on the language selected or the font size selected this might get too complicated.
Barna Biro
11-20-2009, 06:51 PM
An image of what you are trying to achieve and what you have at the moment would really help. As I have already mentioned, the whole problem is not really clear to me and I can't really help without fully understanding the situation/problem. :)
Jerry62712
11-20-2009, 07:29 PM
Attached are two images. The first shows the good (word wrap) and the minor problem with the fields being too tall for one line. The second shows to worse (scroll bar instead of word wrap). What I'm worried about on this is with keyboard access, would it become a pain for JAWs users.
I tried using Text instead of TextArea. The problem is it truncates.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.