You can set the background size to Text.TextWidth, Text.TextHeight + some border. The only problem is that the TextWidth/Height doesn't update immediately when you change the text so you need some delay.
You might keep track of the old values in instance variables so you can detect when it has changed and update the background size accordingly.