﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Difference between user control and form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 10 May 2026 16:06:40 GMT</lastBuildDate><ttl>20</ttl><item><title>Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17845.aspx</link><description>Hi, &lt;/P&gt;&lt;P&gt;I'm still making tests. &lt;/P&gt;&lt;P&gt;I put a list view in a Micro Four User Control which is contained in a Micro Four Form&amp;nbsp;and the time of loading is 2800 ms.&lt;/P&gt;&lt;P&gt;When&amp;nbsp;I put directly the same list in a Micro Four Form, the time is about 450 ms.&lt;/P&gt;&lt;P&gt;What are the reasons of this difference ?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;David</description><pubDate>Thu, 04 Sep 2008 13:00:35 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost19069.aspx</link><description>David,&lt;br&gt;
&lt;br&gt;
I see a couple of things that don't make sense:&lt;br&gt;
&lt;br&gt;
- Were are you calling Requery() on the listview in your user control?&lt;br&gt;
&lt;br&gt;
- I'm thinking that _clientBO.RetournerTousClients(); is a fill method that fills the _clientBO with data.  Are you thinking that this will somehow fill your listview?  Even if the listview is configured to use the same [i]type[/i] of BO as the local [i]instance[/i] _clientBO, it won't use that instance. The listview creates its own instance.  &lt;br&gt;
&lt;br&gt;
If you'd like to use the data from _clientBO to fill the listview, then you need to configure the listview to use the CopyDataFrom method using the businesslayer overload.  Then you [b]must[/b] either pass in the appropriate parameters to the Requery() method OR handle the ListPopulating method and provide those parameters.  In almost all cases it is better to handle the event.  Hope this is starting to make sense.</description><pubDate>Thu, 04 Sep 2008 13:00:35 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost19052.aspx</link><description>You're right Greg. I want to programatically add an user control in my form.&lt;/P&gt;&lt;P&gt;I set the properties by code but nothing happened. I may forgot something but why I don't know.&lt;/P&gt;&lt;P&gt;[code]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; Form1()&lt;BR&gt;{&lt;/P&gt;&lt;P&gt;InitializeComponent();&lt;/P&gt;&lt;P&gt;_clientBO = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ClientBO&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;BR&gt;_clientBO.ParentFormLoading += &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.UI.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;IInitOnFormLoad&lt;/FONT&gt;&lt;FONT size=2&gt;.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ParentFormLoadingEventHandler&lt;/FONT&gt;&lt;FONT size=2&gt;(_clientBO_ParentFormLoading);&lt;/P&gt;&lt;P&gt;_clientBO.ParentContainer = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;BR&gt;_clientBO.SynchronizingObject = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_ucClient = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ucClient&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.PrimaryBusinessObject = _clientBO;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;_BOTranslationItem1.DestinationBusinessObject = &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"_ucClient.clientBO1"&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;BR&gt;_BOTranslationItem1.SourceBusinessObject = &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"Form1._clientBO"&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_ucClient.BOTranslations.AddRange(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessObjectTranslationItem&lt;/FONT&gt;&lt;FONT size=2&gt;[] {&lt;/P&gt;&lt;P&gt;_BOTranslationItem1});&lt;/P&gt;&lt;P&gt;_ucClient.Dock = System.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DockStyle&lt;/FONT&gt;&lt;FONT size=2&gt;.Fill;&lt;/P&gt;&lt;P&gt;_ucClient.ParentContainer = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;BR&gt;_ucClient.TranslationObject = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.Controls.Add(_ucClient);&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; _clientBO_ParentFormLoading()&lt;BR&gt;{&lt;BR&gt;_clientBO.RetournerTousClients();&lt;BR&gt;}&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/code]</description><pubDate>Thu, 04 Sep 2008 09:15:20 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost19001.aspx</link><description>If I understand you correctly, you want to programatically add your user control (that contains a listview) to a form, then setup the listview to use data from a BO on the form.  Assuming this is what you want to do, you have a few options:&lt;br&gt;
&lt;br&gt;
- Expose the listview as a readonly property of the user control so you can setup it up in code. I.e. you'd use client code (the code in your form) something like:&lt;br&gt;
&lt;br&gt;
[codesnippet]UserControl _uc = new UserControl();&lt;br&gt;
//Setup list population settings..&lt;br&gt;
_uc.List.PopulationDataSourceSettings.MethodToExecute = "CopyDataFrom;BusinessLayer,BusinessCloneDataType";&lt;br&gt;
// Add handler for list population (populateList would be the method on the form&lt;br&gt;
// that handles this event)&lt;br&gt;
_uc.List.ListPopulating += new ListPopulatingEventHandler(this.populateList);[/codesnippet]&lt;br&gt;
&lt;br&gt;
- If you are always going to populate the list view from an external BO using CopyDataFrom, you'd be better off to just setup the listview in the user control that way, and add a BO property to your user control of type BusinessLayer. You'd then handle the ListPopulating event within the user control. The client code would then become:&lt;br&gt;
&lt;br&gt;
[codesnippet]UserControl _uc = new UserControl();&lt;br&gt;
// Set BO&lt;br&gt;
_uc.BusinessObject = this.MyLocalBO; //MyLocalBO being the one you want to load from[/codesnippet]&lt;br&gt;
&lt;br&gt;
The code may not be entirely accurate, I just typed it in, but hopefully it gives you an idea of what you might want to do. :D</description><pubDate>Wed, 03 Sep 2008 12:25:29 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18956.aspx</link><description>Hi&lt;/P&gt;&lt;P&gt;I succeed to load a listview in an user control with a designer. But I'm not sure you understand my problem.&lt;BR&gt;I want to add an user control by code&lt;BR&gt;UserControl _uc = new UserControl();&lt;/P&gt;&lt;P&gt;I wonder how to link a BO in the form and in the user control in the code and set the PopulationDataSourceSettings.</description><pubDate>Wed, 03 Sep 2008 07:12:32 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18469.aspx</link><description>OK, there are actually a lot of issues with your approach here and none are related to the BO translations.&amp;nbsp; Now keep in mind that the forum is not intended for training purposes, but I am going to briefly break down where your issues are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You need to ensure that your projects enforce invalid variable declarations, etc. at compile time.&amp;nbsp; You can turn some compiler errors off, and this is not the crux of the issue, but bottom line is that you want to see all errors during a compile...let nothing be ignored.&lt;/LI&gt;&lt;LI&gt;You are not properly using the ListView.&amp;nbsp; First of all, on your user control, you have a ListView that has a PopulationDataSourceSettings set to call your ReturnClientList() (I am paraphrasing here on your method name).&amp;nbsp; This will never work.&amp;nbsp; A ListView creates an internal BO.&amp;nbsp; In your user control, you do not reference or load from the clientBO1 anywhere.&amp;nbsp; So obviously you are not going to be able to load from that BO.&amp;nbsp; In your PopulationDataSourceSettings you need to set the Method To Invoke to CopyDataFrom, the you will handle the ListPopulating event to provide the clientBO1 there so that the instance you are trying to translate will appear.&amp;nbsp; There are a lot of samples on the forum as well as in the install of SF showing how to poipulate a ListView this way...including many examples in the StrataFlix sample.&amp;nbsp; Please refer to these samples to learn how to populate a ListView this way.&lt;/LI&gt;&lt;LI&gt;Once you work through these problems, you will need to override the OnLoad method instead of handling the event (though you can handle the event, overriding the OnLoad gives you the control to place your code before or after the base logic...just good .NET standards).&amp;nbsp; When you setup a BO translation, all of this will be done within the OnLoad of the form and the controls...so you will want to place your logic there.&amp;nbsp; Now once the BO is translated....YOU WILL HAVE to requery the ListView in order to get the updated contents of the translated BO into the ListView.&lt;BR&gt;&lt;BR&gt;lstClients.Requery()&lt;BR&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;That should be enough to get you going down the right path. :)</description><pubDate>Wed, 13 Aug 2008 09:52:31 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18454.aspx</link><description>It would be better with the attachment :D ;)</description><pubDate>Wed, 13 Aug 2008 08:49:17 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18453.aspx</link><description>Hi Dustin,&lt;/P&gt;&lt;P&gt;Here is a new sample without Infragistics references. &lt;BR&gt;In my table, I have 4 columns CodeClient, Nom, CodePostal and Adresse as you can see in my BO.designer.cs.&lt;/P&gt;&lt;P&gt;I don't succeed to load my list when I create manually my uc in my form.&lt;BR&gt;And I&amp;nbsp;don't know why.&lt;/P&gt;&lt;P&gt;Hope this sample will work on your computer.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David</description><pubDate>Wed, 13 Aug 2008 08:46:58 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18425.aspx</link><description>Hi David!&lt;/P&gt;&lt;P&gt;Could you re-post that sample with the infragistic references and toolstrips removed? We don't have the version of infragistics you are using, so we can't build the project as is.&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Tue, 12 Aug 2008 09:38:08 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18411.aspx</link><description>no issue at my problem ?</description><pubDate>Mon, 11 Aug 2008 15:12:05 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18225.aspx</link><description>No worry Trent I just want to know to organize my work.&lt;/P&gt;&lt;P&gt;I will work with Strataframe for many years so&amp;nbsp;I have time :D</description><pubDate>Wed, 30 Jul 2008 09:51:17 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18219.aspx</link><description>I will take a look at this soon, but we have just gotten back from being on the road and have a lot going on and we also have a lot of people out on vacation, so we are still trying to catch up.&amp;nbsp; Thank you for being patient.</description><pubDate>Wed, 30 Jul 2008 09:09:16 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost18211.aspx</link><description>Hi&lt;/P&gt;&lt;P&gt;Did you have the time to test my sample ?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David</description><pubDate>Wed, 30 Jul 2008 02:11:49 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17979.aspx</link><description>Hi Trent,&lt;/P&gt;&lt;P&gt;I send you a sample project. I put the 2 examples. One with my user control created directly on the form by the designer which works. The other in which I create the user control and BOTranslation in the code.&lt;/P&gt;&lt;P&gt;David</description><pubDate>Tue, 22 Jul 2008 03:25:01 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17949.aspx</link><description>I really think that something is missing.&amp;nbsp; I don't think that the IParentFormLoading event will be your solution from looking at your code.&amp;nbsp; We are in the field training again this week, so our time is a bit limited.&amp;nbsp; However, instead of going back and forth, just create a simple sample and then we will take a look instead of going back and forth via the forum.</description><pubDate>Mon, 21 Jul 2008 10:40:59 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17945.aspx</link><description>Hello Trent,&lt;/P&gt;&lt;P&gt;Here is my code.&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;partial&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Form1&lt;/FONT&gt;&lt;FONT size=2&gt; : MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;StandardForm&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ClientBO&lt;/FONT&gt;&lt;FONT size=2&gt; _clientBO;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessObjectTranslationItem&lt;/FONT&gt;&lt;FONT size=2&gt; _BOTranslationItem1 = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessObjectTranslationItem&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ucClient&lt;/FONT&gt;&lt;FONT size=2&gt; _ucClient;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; Form1()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;InitializeComponent();&lt;/P&gt;&lt;P&gt;_clientBO = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ClientBO&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/P&gt;&lt;P&gt;_ucClient = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ucClient&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/P&gt;&lt;P&gt;_clientBO.ParentContainer = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_clientBO.SynchronizingObject = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.PrimaryBusinessObject = _clientBO;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.Width = 1000;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.Height = 750;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.WindowState = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;FormWindowState&lt;/FONT&gt;&lt;FONT size=2&gt;.Normal;&lt;/P&gt;&lt;P&gt;_BOTranslationItem1.DestinationBusinessObject = &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"_ucClient.clientBO1"&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_BOTranslationItem1.SourceBusinessObject = &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"Form1._clientBO"&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_ucClient.BOTranslations.AddRange(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessObjectTranslationItem&lt;/FONT&gt;&lt;FONT size=2&gt;[] {&lt;/P&gt;&lt;P&gt;_BOTranslationItem1});&lt;/P&gt;&lt;P&gt;_ucClient.Dock = System.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DockStyle&lt;/FONT&gt;&lt;FONT size=2&gt;.Fill;&lt;/P&gt;&lt;P&gt;_ucClient.ParentContainer = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_ucClient.TranslationObject = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; Form1_Load(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;_ucClient.Visible = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;_ucClient.OnFermerFenetre += &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventHandler&lt;/FONT&gt;&lt;FONT size=2&gt;(_ucClient_OnFermerFenetre);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.Controls.Add(_ucClient);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; _ucClient_OnFermerFenetre(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;((MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;UserControl&lt;/FONT&gt;&lt;FONT size=2&gt;)(sender)).ParentForm.Close();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;David</description><pubDate>Mon, 21 Jul 2008 10:17:52 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17938.aspx</link><description>[quote]What can I do ?[/quote]&lt;/P&gt;&lt;P&gt;Well, let's go at it from this perspective.&amp;nbsp; The BOs get translated within the Load of the form.&amp;nbsp; The SF users controls also have a property that exposes which object from which to translate.&amp;nbsp; I am not answering from a machine with VS on it (long story), but the user control has a property called TranslationObject (I think), but it will be iin the same category as the BOTranslations property of the UserControl.&lt;/P&gt;&lt;P&gt;You can set this to the form (or even set it in code) and it may resolve your problem.&amp;nbsp; If not, you can also implement the IParentFormLoading interface to control the initialization of the control.&amp;nbsp; But let's start with the first before we get into the second.</description><pubDate>Mon, 21 Jul 2008 09:23:32 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17926.aspx</link><description>Hi Trent,&lt;/P&gt;&lt;P&gt;In fact, I want to use User Control to re use them in several screens. So I want to use code to create dynamicly my user controls and&amp;nbsp; I don't manage to create translations between my form and my user control. &lt;/P&gt;&lt;P&gt;When I put my user control in my form on the designer it works correctly.&lt;/P&gt;&lt;P&gt;Nevertheless, when&amp;nbsp;I do the same by code by creating myself translations in the Form_Load(), it doesn't work. I put code before the InitializeComponent() and after but the result is the same.&lt;/P&gt;&lt;P&gt;What can I do ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;David</description><pubDate>Sun, 20 Jul 2008 15:54:52 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17922.aspx</link><description>Really either.&amp;nbsp; It depends on what you are trying to accomplish with the user control.&amp;nbsp; But if you add this before the MyBase.OnLoad method when overriding the OnLoad of the form, you will be fairly certain to create the translations before any translations take place.</description><pubDate>Sat, 19 Jul 2008 15:01:20 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17905.aspx</link><description>In which OnLoad ? In the form or in the user control ?</description><pubDate>Thu, 17 Jul 2008 09:18:51 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17904.aspx</link><description>Gotcha....yes, you can do this in code, but you will have to do it in the OnLoad prior to the MyBase.OnLoad gets called so that the translations take place in the natural or expected order.&amp;nbsp; This is actually something that we do a bit ourselves.</description><pubDate>Thu, 17 Jul 2008 08:57:26 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17897.aspx</link><description>Thanks for your help Trent,&lt;/P&gt;&lt;P&gt;I follow your method and it's work.&lt;/P&gt;&lt;P&gt;But if I want to do the same by code and not by the designer, I don't manage to laod my list.&lt;/P&gt;&lt;P&gt;Do I forget something in the code I posted before ?&lt;/P&gt;&lt;P&gt;David</description><pubDate>Thu, 17 Jul 2008 08:44:10 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17894.aspx</link><description>David,&lt;/P&gt;&lt;P&gt;First, I think that you are making this harder than you need to in regards to the user control.&amp;nbsp; Just for a little background, we have a large number of user controls that are used within dialogs and forms which in turn use the BO translations between the two.&amp;nbsp; Here is how a user control is intended to work:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Drop your BOs on a user control and bind to them just as though they were on a form&lt;/LI&gt;&lt;LI&gt;Once the user control is written, drop that user control on a form or dialog &lt;/LI&gt;&lt;LI&gt;Drop on the BOs of the same type that were dropped on the user control &lt;/LI&gt;&lt;LI&gt;Then build the project&lt;/LI&gt;&lt;LI&gt;Stay within the designer, and select the user control&lt;/LI&gt;&lt;LI&gt;Go the BO Translations of the user control and click the "..." button&lt;/LI&gt;&lt;LI&gt;This will then bring up a translations dialog.&amp;nbsp; Add a translation for each BO that needs to be translated from the dialog into the user control...they will have to be of the same BO type on each translation (one for one).&lt;/LI&gt;&lt;LI&gt;Now populate the BOs on the form (or the user control can populate them if this is how you intend your app to work, but just for arguments sake, lets populate the Bos on the dialog here)&lt;/LI&gt;&lt;LI&gt;Now when you run, you should be able to populate the BOs on the form and you will see them reflected within the user control&lt;/LI&gt;&lt;/OL&gt;</description><pubDate>Thu, 17 Jul 2008 08:35:50 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17893.aspx</link><description>Just one more thing, there is an error in my code.&lt;/P&gt;&lt;P&gt;The line "_ucClient.BOTranslations.Add(_BOTranslationItem1);" isn't not in my code.&lt;/P&gt;&lt;P&gt;David</description><pubDate>Thu, 17 Jul 2008 08:22:24 GMT</pubDate><dc:creator>David Daragon</dc:creator></item><item><title>RE: Difference between user control and form</title><link>http://forum.strataframe.net/FindPost17892.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I succeed to have the same time of loading when I put a list directly in a form and when I put a list in user control contained in a form.&lt;/P&gt;&lt;P&gt;The problem seems to come from the parameters of the BOTranslation I did.&lt;/P&gt;&lt;P&gt;So, now, I have a time of loading equals to 520 ms in a user control. It's better :)&lt;/P&gt;&lt;P&gt;But, I'm trying to do this by code but my list doesn't load :crying:&lt;/P&gt;&lt;P&gt;I have this code in my form_load:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ucClient _ucClient = new ucClient();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ucClient.Dock = DockStyle.Fill;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ucClient.Visible = true;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ucClient.OnFermerFenetre += new EventHandler(_ucClient_OnFermerFenetre);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Controls.Add(_ucClient);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessObjectTranslationItem _BOTranslationItem1 = new BusinessObjectTranslationItem();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _BOTranslationItem1.SourceBusinessObject = "Form1.clientBO1";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _BOTranslationItem1.DestinationBusinessObject = "_ucClient.clientBO1";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ucClient.BOTranslations.AddRange(new BusinessObjectTranslationItem[] { _BOTranslationItem1 });&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ucClient.BOTranslations.Add(_BOTranslationItem1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ucClient.TranslationObject = this;&lt;/P&gt;&lt;P&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;What's wrong ?&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;David</description><pubDate>Thu, 17 Jul 2008 07:59:29 GMT</pubDate><dc:creator>David Daragon</dc:creator></item></channel></rss>