﻿<?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?)  » How to Acces to a Mainform ?</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 07:38:24 GMT</lastBuildDate><ttl>20</ttl><item><title>How to Acces to a Mainform ?</title><link>http://forum.strataframe.net/FindPost23695.aspx</link><description>Hello ,&lt;br&gt;
&lt;br&gt;
I hope somebody can help me.&lt;br&gt;
&lt;br&gt;
How can i acess to a mainform which is added over InitApplication in AppMain ?&lt;br&gt;
&lt;br&gt;
e.Forms.Add(GetType(MKSApplication.MKSBaseApplicationFormWithNB))&lt;br&gt;
&lt;br&gt;
I need a Reference to this form.&lt;br&gt;
&lt;br&gt;
thanks&lt;br&gt;
&lt;br&gt;
Rainer &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;</description><pubDate>Mon, 29 Jun 2009 14:25:06 GMT</pubDate><dc:creator>Rainer Kempf, RK</dc:creator></item><item><title>RE: How to Acces to a Mainform ?</title><link>http://forum.strataframe.net/FindPost23709.aspx</link><description>Not sure why a CType would work instead of a DirectCast (CType calls DirectCast internally if I remember correctly), but I'm glad you got it working.</description><pubDate>Mon, 29 Jun 2009 14:25:06 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to Acces to a Mainform ?</title><link>http://forum.strataframe.net/FindPost23707.aspx</link><description>Hello Greg&lt;br&gt;
&lt;br&gt;
Thanks for your help&lt;br&gt;
&lt;br&gt;
I solved prolem over a Ctype&lt;br&gt;
&lt;br&gt;
thanks &lt;br&gt;
&lt;br&gt;
Rainer</description><pubDate>Mon, 29 Jun 2009 12:01:08 GMT</pubDate><dc:creator>Rainer Kempf, RK</dc:creator></item><item><title>RE: How to Acces to a Mainform ?</title><link>http://forum.strataframe.net/FindPost23706.aspx</link><description>Hello Greg&lt;br&gt;
&lt;br&gt;
Sorry but it seems i am to stupid to completly understand.&lt;br&gt;
&lt;br&gt;
i did following :&lt;br&gt;
&lt;br&gt;
	e.Forms.Add(GetType(MKS.Application.MKSBAseApplicationFormWithNB))&lt;br&gt;
&lt;br&gt;
        Dim LoMyForm As MKS.Application.MKSBAseApplicationFormWithNB&lt;br&gt;
        LoMyForm = DirectCast(StrataFrameApplication.MainForm, MKS.Application.MKSBAseApplicationFormWithNB)&lt;br&gt;
&lt;br&gt;
And if i try to access to MyLoForm  i see nothing.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
But in MKSBAseApplicationFormWithNB exist Public properties like pmks_load_ribbonbar&lt;br&gt;
&lt;br&gt;
But i can't see this property after casting.&lt;br&gt;
&lt;br&gt;
So what i made wrong ?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
thanks for your patience and help&lt;br&gt;
&lt;br&gt;
Rainer&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
	&lt;br&gt;
&lt;br&gt;</description><pubDate>Mon, 29 Jun 2009 11:55:22 GMT</pubDate><dc:creator>Rainer Kempf, RK</dc:creator></item><item><title>RE: How to Acces to a Mainform ?</title><link>http://forum.strataframe.net/FindPost23705.aspx</link><description>You'll need to cast the MainForm to you're type:&lt;br&gt;
&lt;br&gt;
VB.NET&lt;br&gt;
[codesnippet]DirectCast(StrataFrameApplication.MainForm,MKSApplication.MKSBaseApplicationFormWithNB)[/codesnippet]&lt;br&gt;
&lt;br&gt;
C#&lt;br&gt;
[codesnippet](MKSApplication.MKSBaseApplicationFormWithNB) StrataFrameApplication.MainForm;[/codesnippet]</description><pubDate>Mon, 29 Jun 2009 10:40:30 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to Acces to a Mainform ?</title><link>http://forum.strataframe.net/FindPost23701.aspx</link><description>Hello Greg,&lt;/P&gt;&lt;P&gt;Thank you for your anwser, but problem not solved in this way.&lt;/P&gt;&lt;P&gt;.Forms.Add(GetType(MKSApplication.MKSBaseApplicationFormWithNB))&lt;/P&gt;&lt;P&gt;I had a baseclass of MKSApplication.MKSBaseApplicationFormWithNB&lt;/P&gt;&lt;P&gt;in this Baseclass i had a lot of public Properties on which i want to access.&lt;/P&gt;&lt;P&gt;So when i try to access to Strataframe.application.mainform i can't see this properties.&lt;/P&gt;&lt;P&gt;How to handel this ?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Rainer</description><pubDate>Sun, 28 Jun 2009 03:33:52 GMT</pubDate><dc:creator>Rainer Kempf, RK</dc:creator></item><item><title>RE: How to Acces to a Mainform ?</title><link>http://forum.strataframe.net/FindPost23699.aspx</link><description>I believe it is:&lt;br&gt;
&lt;br&gt;
[codesnippet]StrataFrameApplication.MainForm[/codesnippet]&lt;br&gt;
&lt;br&gt;
If you need access to something specific on that form, you'll need to do a cast, as this property is just a standard windows form.</description><pubDate>Sat, 27 Jun 2009 00:44:44 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>