I answered my own question. I added a public void to WinLogin.cs
public void ReturnNames()
{
FullName = TxtUserName.Text;
Domain = TxtDomain.Text;
}
and in Form1
var win = new WinLogin { Owner = this };
win.ShowDialog();
if (!win.DialogResult.HasValue || !win.DialogResult.Value)
Close();
else
win.ReturnNames();
TBoxPharmSign.Text = GetUserFullName(win.Domain,win.FullName);
}
And also in Form1
public static string GetUserFullName(string domain, string userName)
{
DirectoryEntry userEntry = new DirectoryEntry("WinNT://" + domain + "/" + userName + ",User");
return (string)userEntry.Properties["fullname"].Value;
}
in a nutshell, WinLogin.cs - ReturnNames() sets FullName and Domain equal to the values the user inputs on the screen.
Form1 builds the query to AD using GetUserFullName()
The eSign_Click in Form1 runs WinLogin - ReturnNames() and sets the textbox to the returned values from GetUserFullName()... :)