[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]
So, what is the best method to load the form, allow it to be accessible and open every time?
Thanks