[img]https://social.msdn.microsoft.com/Forums/getfile/1010862[/img]
So, what is the best method to load the form, allow it to be accessible and open every time?

Thanks"> [img]https://social.msdn.microsoft.com/Forums/getfile/1010862[/img]
So, what is the best method to load the form, allow it to be accessible and open every time?

Thanks"> [img]https://social.msdn.microsoft.com/Forums/getfile/1010862[/img]
So, what is the best method to load the form, allow it to be accessible and open every time?

Thanks">
What would be the correct method to create an instance of a form? Currently, I add this to my AddinGlobal class in my Class project-
[code]Public Shared fForm As Form [/code] Then, when I need the form to be shown, I use this in the ribbon button command (loaded into Inventor)
[code]AddinGlobal.fForm = New fMain AddinGlobal.fForm.Show()[/code] This creates a new instance of the form. I have done it this way so that fForm can be accessed by other functions.

In my Form Class, I have these members that are new instances of some UserControls I have created [code]Public Shared pgStructure As New pAssyStructure Private pgAssembly As New pAssembly Private pgBorders As New pAssembly Private pgFlatPatt As New pFlatPattern Private pgPart As New pPart Private pgPresentation As New pPresentation Private pgSetting As New pSettings Private pgFrontSheet As New pFront[/code] Problem:

When I load the form first time, it works fine and everything loads as it should. When I close the form and then open it again, I get an error[img]https://social.msdn.microsoft.com/Forums/getfile/1010862[/img]
So, what is the best method to load the form, allow it to be accessible and open every time?

Thanks


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir