A temptative workaround could be to create a temporary panel from scratch and duplicate the text box on the new panel.
On this temporary panel you can get the number of text lines in the text box (with ATTR_TOTAL_LINES attribute) and resize it to show all of them (ATTR_VISIBLE_LINES attribute), next save the textbox and discard the temporary panel.
Hope this helps
Roberto