﻿<?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?)  » Getting Instance of child form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 14:37:33 GMT</lastBuildDate><ttl>20</ttl><item><title>Getting Instance of child form</title><link>http://forum.strataframe.net/FindPost1340.aspx</link><description>Hi i am trying to set the title and detail text of a header when the form loads, this would normally work in straight vb, i cant see why its not when using the child dialog. &lt;BR&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Private&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Sub&lt;/FONT&gt;&lt;FONT size=1&gt; GridControl1_DoubleClick(&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;ByVal&lt;/FONT&gt;&lt;FONT size=1&gt; sender &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;As&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Object&lt;/FONT&gt;&lt;FONT size=1&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;ByVal&lt;/FONT&gt;&lt;FONT size=1&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;As&lt;/FONT&gt;&lt;FONT size=1&gt; System.EventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Handles&lt;/FONT&gt;&lt;FONT size=1&gt; GridControl1.DoubleClick&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; My&lt;/FONT&gt;&lt;FONT size=1&gt;.Forms.CustomerEditForm.GradientFormHeader1.Title = &lt;/FONT&gt;&lt;FONT color=#800000 size=1&gt;"Editing Customer..."&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; My&lt;/FONT&gt;&lt;FONT size=1&gt;.Forms.CustomerEditForm.GradientFormHeader1.DetailText = &lt;/FONT&gt;&lt;FONT color=#800000 size=1&gt;"TEST"&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Me&lt;/FONT&gt;&lt;FONT size=1&gt;.ShowCustomerEdit.ShowDialog = Windows.Forms.DialogResult.OK &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Then&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerBO1.Save()&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/FONT&gt;&lt;FONT size=1&gt; ex &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;As&lt;/FONT&gt;&lt;FONT size=1&gt; Exception&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show(ex.Message)&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Try&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerBO1.RejectChanges()&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;If&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;CustomerBO1.Refresh()&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;End&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Sub&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=1&gt;Regards Wyane&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 02 Jun 2006 14:00:28 GMT</pubDate><dc:creator>Wayne Van Rooyen</dc:creator></item><item><title>RE: Getting Instance of child form</title><link>http://forum.strataframe.net/FindPost1349.aspx</link><description>Glad I could help, Wayne :)&lt;/P&gt;&lt;P&gt;1) I'm not positive that the documentation is the latest one available... I've been adding to the CHM quite a bit, I just need to publish it.&amp;nbsp; I'll let you know when I do.&lt;/P&gt;&lt;P&gt;2) The product was officially released on November 21, 2005 (being .NET 2.0 only, we had to wait on VS2005 and .NET 2.0 to be officially released).&amp;nbsp; We put out maintenance releases as needed (like the one I built for you yesterday), and a full release is posted about once a month.&lt;/P&gt;&lt;P&gt;3) The Infragistics wrapper is not going to well.&amp;nbsp; They seem to have stuck their legal department on us and have repeatedly said that if we release any developer product that uses their product, we have to resell a license of their product.&amp;nbsp; So, basically, we're at the point of giving up on releasing one.&amp;nbsp; However, if some community members were to get together and write a wrapper DLL, they could host it here as an open source solution.</description><pubDate>Fri, 02 Jun 2006 14:00:28 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Getting Instance of child form</title><link>http://forum.strataframe.net/FindPost1348.aspx</link><description>Thanks Ben, its amazing how little things like that can slip the mind when you are learning new technology. I mean that was pretty straight forward but the mind was just not seeing it that way.:w00t:&lt;/P&gt;&lt;P&gt;Some General Questions:&lt;BR&gt;1)&amp;nbsp;Is the documentation on&amp;nbsp;the website the latest one available, mine has a few pages that are blank. &lt;BR&gt;&lt;BR&gt;2) I believe the product is also fairly new on the market and would also like to know how often updates are put out.&lt;BR&gt;&lt;BR&gt;3) What is the situation regarding infragistics, i read the post on the forum regarding the issues they have with you guys writing a wrapper. How is this going will there be a wrapper in the future.&lt;BR&gt;&lt;BR&gt;Thanks Wayne</description><pubDate>Fri, 02 Jun 2006 13:47:32 GMT</pubDate><dc:creator>Wayne Van Rooyen</dc:creator></item><item><title>RE: Getting Instance of child form</title><link>http://forum.strataframe.net/FindPost1347.aspx</link><description>Sorry, Wayne, I left that part out.&amp;nbsp; What you'll need is a constructor on your CustomerEditForm form that looks like this:&lt;P&gt;Public Class CustomerEditForm&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New(ByVal Title As String, ByVal Detail As String)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Set the text on the gradient form header&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.GradientFormHeader1.Title = Title&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.GradientFormHeader1.DetailText = Detail&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub &lt;BR&gt;End Class&lt;/P&gt;&lt;P&gt;Once you have this constructor declared, all you'll have to do is pass the parameters to the ShowDialog() command, and they will be passed through to the constructor.</description><pubDate>Fri, 02 Jun 2006 13:27:04 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Getting Instance of child form</title><link>http://forum.strataframe.net/FindPost1346.aspx</link><description>Hi Ben,&lt;BR&gt;I tried what you did ther but where is the constructor for the child form supposed to be created as this passes the string to the form, but doesnt tell it what to do with then.&lt;/P&gt;&lt;P&gt;When running this i get a error shown below.&lt;/P&gt;&lt;P&gt;Constructor on type 'WinAPP.CustomerEditForm' not found.</description><pubDate>Fri, 02 Jun 2006 13:21:07 GMT</pubDate><dc:creator>Wayne Van Rooyen</dc:creator></item><item><title>RE: Getting Instance of child form</title><link>http://forum.strataframe.net/FindPost1341.aspx</link><description>Ah, when you call ShowDialog() on the child form dialog, it creates a new instance of the child form and then shows it.&amp;nbsp; So, if you want to set the text and detail dynamically, you'll need to pass them over in the constructor of the form.&amp;nbsp; So, your constructor would take 2 parameters (both string) one for the text, and one for the detail.&amp;nbsp; Then, there is a ParamArray of arguments on the ShowDialog() cal that gets passed to the constructor.&amp;nbsp; Looks like this:&lt;/P&gt;&lt;P&gt;Dim lcTitle As String&amp;nbsp;= "Editing Customer..."&lt;BR&gt;Dim lcDetail As String = "TEST"&lt;BR&gt;&lt;/P&gt;&lt;P&gt;If Me.ShowCustomerEdit.ShowDialog(lcTitle, lcDetail)&amp;nbsp;= Windows.Forms.DialogResult.OK Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerBO1.Save()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show(ex.Message)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;BR&gt;Else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerBO1.Undo()&lt;BR&gt;End If&lt;BR&gt;&lt;/P&gt;&lt;P&gt;Also notice I used Undo() rather than RejectChanges().&amp;nbsp; RejectChanges is like calling RejectChanges() directly on the CurrentDataTable of the business object, while Undo() raises the BeforeUndo(), AfterUndo() events and refreshes all of the bounds controls when it's done (so you don't have to call Refresh(), either).</description><pubDate>Fri, 02 Jun 2006 09:04:29 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>