You can also -instead of using variables- publish the required methods/properties from a form, so other parts of the program can do whatever you need in a more encapsulated way.
Assume Form1 needs to add text to a control on Form2. I would go as follows: FORM2 CODE: * Public Sub AddText(newText As String) Listbox1.Add(newText) Me.Show 'This is optional. End* FORM1 CODE: * Private $myF2 As New Form2 [ ... more code ...] $myF2.AddText("Add This Text!")* You can either have Form2 as a private object to Form1 as shown or it can be set up in a global module as a global reference. Your choice. Advantages are several: You can customize whatever you do with the text (in the example) in one place only, or you can change the control (*Form2.Listbox1* in this case) to a different type (*ListView* maybe?) and not have to edit your whole program to adapt to the change. HTH, zxMarce. -- View this message in context: http://gambas.8142.n7.nabble.com/How-to-mention-in-code-widgets-which-are-in-sub-form-in-the-main-fourm-s-code-tp55455p55461.html Sent from the gambas-user mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user