tabpanel - write text to file

Hi,
I have a tab panel with 5 tabs (MsgTab 1…MsgTab 5), each tab has a textArea (TabMsg1, TabMsg2 … TabMsg5).

A save button if put it inside MsgTab 5, contain a line (Works perfectly…but have to create 5 save buttons!)

fs.WriteLine(TabMsg5.Text)

Problem : Trying to just ONE save button outside the Tab Panel.
Tried : fs.WriteLine(“TabMsg” + str((TabMsgPanel.Value) + 1) + “.Text”) but not the same as fs.WriteLine(TabMsg5.Text)

Is it even possible to create a xojo component (TabMsg5.Text)?

Thanks

take a look at control arrays and use an index to get their value.

Thank very much got it!