To keep it as simple as possible, I have a desktop project with 2 windows:
The First (wContacts) is a “Document” type window. It displays information about vendors, customers etc. There is a textfield with the contacts email address. Next to it is a bevel button with an Action event that sets 3 public fields in the 2nd window with name, company, and email address:
The 2nd window (wEmail) is a “Sheet” type window (I’m on a Mac) with the 3 public string fields declared as string. In the Open event of wEmail I assign 3 textfields to the values of the public string fields:
I placed a trace point at the 1st line of code in the action event of the bevel button and examined the textfields and they all contained the correct information.
BUT, when the wEmail window opens, the string fields are empty
I’m on a Mac Pro with macOS 10.11.1 and Xojo v2017r1.1
So, what am I missing - besides sitting here writing code at 7:00 on a Friday night…
The Open event of an implicit instance can happen as early as you touch the window the first time, ie the line you’re setting wEmail.sEmailAddress. Your code then proceeds to set variables, and then show the modal (if it’s a Sheet, why are you not using ShowModalWithin?), but not set the variables to the interface because Open has already happened.
You may have more success with a method on the sheet window that handles the setting / display, something like:
[code]Sub Display(sName as String, sEmail as String, sCompany as String, winParent as Window)
GetSMTPServer
GetUser
LoadSignatureMenu
PopulateUI