﻿<?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 / WinForms (How do I?)  / Runing a form from the MainForm menu / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Wed, 07 Jan 2009 17:24:46 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Runing a form from the MainForm menu</title><link>http://forum.strataframe.net/Topic511-7-1.aspx</link><description>That code (or something very similar to it) should be in the StrataFrame VB.NET sample within your program files.  In the MainForm.vb file, is the MDI form where you should find the code.</description><pubDate>Wed, 26 Apr 2006 15:01:52 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>RE: Runing a form from the MainForm menu</title><link>http://forum.strataframe.net/Topic511-7-1.aspx</link><description>Would you guys happen to have an MDI sample in VB .NET that I could download and inspect?  I guess I want to use as much of your framework as possible and utilize all the power it contains. I want to avoid doing things the "long" way or the "hard" way. :D</description><pubDate>Wed, 26 Apr 2006 14:58:35 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Runing a form from the MainForm menu</title><link>http://forum.strataframe.net/Topic511-7-1.aspx</link><description>That code goes in the MDI parent, not the children.  So, you can easily show the child forms without having to copy the code to each of them.</description><pubDate>Wed, 26 Apr 2006 14:52:09 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>RE: Runing a form from the MainForm menu</title><link>http://forum.strataframe.net/Topic511-7-1.aspx</link><description>Where would the code Ben supplied go? In the MDI Parent form or in each of the children?</description><pubDate>Wed, 26 Apr 2006 14:50:32 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Runing a form from the MainForm menu</title><link>http://forum.strataframe.net/Topic511-7-1.aspx</link><description>Thanks for the help Ben.&lt;BR&gt;Well, to be honest, is there a "sign language" in .NET ?  :D</description><pubDate>Fri, 03 Feb 2006 17:19:25 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Runing a form from the MainForm menu</title><link>http://forum.strataframe.net/Topic511-7-1.aspx</link><description>Hehe, no problem, Ivan... it can get pretty complex just showing the forms (which at first seems like something simple).  Here's some generic code we use within our forms to show the child (MDI) forms.&lt;br&gt;&lt;br&gt;''' &lt;summary&gt;&lt;br&gt;''' Show a form&lt;br&gt;''' &lt;/summary&gt;&lt;br&gt;''' &lt;param name="FormType"&gt;&lt;/param&gt;&lt;br&gt;''' &lt;remarks&gt;&lt;/remarks&gt;&lt;br&gt;Public Sub ShowForm(ByVal FormType As System.Type)&lt;br&gt;	Me.ShowForm(FormType, Nothing)&lt;br&gt;End Sub&lt;br&gt;&lt;br&gt;''' &lt;summary&gt;&lt;br&gt;''' Show a form&lt;br&gt;''' &lt;/summary&gt;&lt;br&gt;''' &lt;param name="FormType"&gt;&lt;/param&gt;&lt;br&gt;''' &lt;remarks&gt;&lt;/remarks&gt;&lt;br&gt;Public Sub ShowForm(ByVal FormType As System.Type, ByVal ParamArray Parameters() As Object)&lt;br&gt;	'-- Establish Locals&lt;br&gt;	Dim loForm As Object&lt;br&gt;	Dim llFound As Boolean&lt;br&gt;&lt;br&gt;	'-- Make sure the form is not currently open&lt;br&gt;	For Each loForm In Me.MdiChildren&lt;br&gt;		If loForm.GetType() Is FormType Then&lt;br&gt;			'-- The form is already shown, so just activate it&lt;br&gt;			CType(loForm, Form).Activate()&lt;br&gt;			llFound = True&lt;br&gt;		End If&lt;br&gt;	Next&lt;br&gt;&lt;br&gt;	If Not llFound Then&lt;br&gt;		If Parameters Is Nothing Then&lt;br&gt;			loForm = Activator.CreateInstance(FormType)&lt;br&gt;		Else&lt;br&gt;			loForm = Activator.CreateInstance(FormType, Parameters)&lt;br&gt;		End If&lt;br&gt;	&lt;br&gt;		With CType(loForm, MicroFour.StrataFrame.UI.Windows.Forms.BaseForm)&lt;br&gt;			.MdiParent = Me&lt;br&gt;			.Show()&lt;br&gt;		End With&lt;br&gt;	End If&lt;br&gt;End Sub&lt;br&gt;&lt;br&gt;Say you have a child form called Form2, then to show it, you would call ShowForm(GetType(Form2)).  If you need to pass parameters to the constructor, that's what the second overload is for.  &lt;br&gt;&lt;br&gt;Lemme know if you need this in C#... I can't remember your language (I know it's Portuguese, but I'm talking C#/VB :))</description><pubDate>Fri, 03 Feb 2006 15:43:00 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>Runing a form from the MainForm menu</title><link>http://forum.strataframe.net/Topic511-7-1.aspx</link><description>Hi guys.&lt;P&gt;Right, created the database in SQL, the SF application, the BOs for the tables, the SFMaintenanceForms for them, and now the SFappMainForm. Look, all of this new for me.&lt;/P&gt;&lt;P&gt;I'm wandering what code to use in the SFMainForm menu strip item to call the forms. Will I use a SF method for this ? Not using the ToolStrip yet ... &lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;P&gt;Ivan</description><pubDate>Fri, 03 Feb 2006 14:17:28 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>