Hello Trent,
Here is my code.
public partial class Form1 : MicroFour.StrataFrame.UI.Windows.Forms.StandardForm{
private ClientBO _clientBO;private BusinessObjectTranslationItem _BOTranslationItem1 = new BusinessObjectTranslationItem();private ucClient _ucClient; public Form1()
{
InitializeComponent();
_clientBO = new ClientBO();
_ucClient = new ucClient();
_clientBO.ParentContainer = this;
_clientBO.SynchronizingObject = this;
this.PrimaryBusinessObject = _clientBO;
this.Width = 1000;
this.Height = 750;
this.WindowState = FormWindowState.Normal;
_BOTranslationItem1.DestinationBusinessObject = "_ucClient.clientBO1";
_BOTranslationItem1.SourceBusinessObject = "Form1._clientBO";
_ucClient.BOTranslations.AddRange(new MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslationItem[] {
_BOTranslationItem1});
_ucClient.Dock = System.Windows.Forms.DockStyle.Fill;
_ucClient.ParentContainer = this;
_ucClient.TranslationObject = this;
}
private void Form1_Load(object sender, EventArgs e)
{
_ucClient.Visible = true;
_ucClient.OnFermerFenetre += new EventHandler(_ucClient_OnFermerFenetre);
this.Controls.Add(_ucClient);
}
void _ucClient_OnFermerFenetre(object sender, EventArgs e)
{
((MicroFour.StrataFrame.UI.Windows.Forms.UserControl)(sender)).ParentForm.Close();
}
}
I already set the TranslationObject property of my user control to my form. So, I will implement the IParentFormLoading interface to control the initialization of the control as you said.
David