﻿<?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 » Business Objects and Data Access (How do I?)  » Accessing childform-properties</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 21 May 2026 09:56:38 GMT</lastBuildDate><ttl>20</ttl><item><title>Accessing childform-properties</title><link>http://forum.strataframe.net/FindPost31850.aspx</link><description>Hi there,&lt;br/&gt;&lt;br/&gt;is there a way to access the public properties of a childform after being called by the parent with a childform-dialog like:&lt;br/&gt;&lt;br/&gt;Dim nKunr as integer = 0&lt;br/&gt;&lt;br/&gt;if me.childformxy.showdialog = dialogresult.ok&lt;br/&gt;&lt;br/&gt;...nKunr = childformxy.nKundennr&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Thu, 21 Feb 2013 13:51:05 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Accessing childform-properties</title><link>http://forum.strataframe.net/FindPost31858.aspx</link><description>Hi Ben,&lt;br/&gt;&lt;br/&gt;thanks a lot, I've got it working.&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Thu, 21 Feb 2013 13:51:05 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Accessing childform-properties</title><link>http://forum.strataframe.net/FindPost31857.aspx</link><description>You will have to save off the reference in a private field of the child dialog.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Public Class MyChildForm&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Public Sub New(p as MyParams)&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Me._params = p&lt;div&gt;&amp;nbsp; &amp;nbsp;End Sub&lt;div&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Private _params As MyParams&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Private Sub HandleClick(sender As Object, e As EventArgs)&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Set the parameter's property where ever you need&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Me._params.nKunr = 7&lt;div&gt;&amp;nbsp; &amp;nbsp;End Sub&lt;br/&gt;&lt;br/&gt;&lt;div&gt;End Class&lt;br/&gt;&lt;br/&gt;&lt;div&gt;After the ShowDialog(p) exits, p.nKunr will have the proper value because p and the Me._params of the child form are the same object.</description><pubDate>Thu, 21 Feb 2013 13:22:33 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Accessing childform-properties</title><link>http://forum.strataframe.net/FindPost31856.aspx</link><description>Hi Ben,&lt;br/&gt;&lt;br/&gt;after trying it, I found problem:&lt;br/&gt;&lt;br/&gt;Internal Class MyParams &lt;br/&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;Public nKunr As Integer End Class&lt;br/&gt;&lt;br/&gt;'-- Child form's constructor Public Sub New(p As MyParams) &amp;nbsp; &amp;nbsp;'-- Save off the params to set the value End Sub&lt;br/&gt;&lt;br/&gt;'-- Show dialog Dim p As New MyParams If Me.childformxy.ShowDialog(p) = DialogResult.OK &amp;nbsp; &amp;nbsp;'-- p.nKunr has value that was set by the child form End If&amp;nbsp;Your sample assumes that I add the needed value in the new-method but what to do with the parameter-class if I have to set the values in another procedure? I don't have access to the object outside the new-method?&amp;nbsp;Best regards&amp;nbsp;Thomas&amp;nbsp;&amp;nbsp;</description><pubDate>Thu, 21 Feb 2013 13:18:03 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Accessing childform-properties</title><link>http://forum.strataframe.net/FindPost31854.aspx</link><description>Hi Ben,&lt;br/&gt;&lt;br/&gt;thanks for your help. &lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Thu, 21 Feb 2013 11:06:08 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Accessing childform-properties</title><link>http://forum.strataframe.net/FindPost31853.aspx</link><description>No, there isn't, sorry. &amp;nbsp;The ChildFormDialog disposes of the created child dialog before the ShowDialog() method exits. &amp;nbsp;If you need to pass data back out of the child dialog, you could create a "parameters" class that is passed to the child form. &amp;nbsp;The child form could then set the values you need on it. &amp;nbsp;Since a class is a reference type, the object will have the values after the ShowDialog() method exits.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Internal Class MyParams&lt;div&gt;&amp;nbsp; &amp;nbsp;Public nKunr As Integer&lt;div&gt;End Class&lt;br/&gt;&lt;br/&gt;&lt;div&gt;'-- Child form's constructor&lt;div&gt;Public Sub New(p As MyParams)&lt;div&gt;&amp;nbsp; &amp;nbsp;'-- Save off the params to set the value&lt;div&gt;End Sub&lt;br/&gt;&lt;br/&gt;&lt;div&gt;'-- Show dialog&lt;div&gt;Dim p As New MyParams&lt;div&gt;If Me.childformxy.ShowDialog(p) = DialogResult.OK&lt;div&gt;&amp;nbsp; &amp;nbsp;'-- p.nKunr has value that was set by the child form&lt;div&gt;End If</description><pubDate>Thu, 21 Feb 2013 09:59:11 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>