32
of 76
TEP , The Engineering Projects , Image

syedzainnasir

TEP , The Engineering Projects , Rating 7.5 7.5 / 10
TEP , The Engineering Projects , Icon Level: Moderator
TEP , The Engineering Projects , Icon Joined: 20 Mar 2022
TEP , The Engineering Projects , Icon Last Active: 2:21 PM
TEP , The Engineering Projects , Icon Location: TEP , The Engineering Projects , Flag
TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon
Opening & Closing forms correctly
TEP , The Engineering Projects , Calender Question: 07-Mar-2017
TEP , The Engineering Projects , Category In: Microsoft Visual Studio Projects
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
TEP , The Engineering Projects , Icon Answer: 0 TEP , The Engineering Projects , Icon Views: 150 TEP , The Engineering Projects , Icon Followers: 85
Small Bio
TEP , The Engineering Projects , Tags
PLC
Robot
STM32
Arduino
AI
ESP32
Ladder Logic
PLC Projects
Programming
Communicates STM32
PLC Projects
Communicates PLC
Font Style
Alignment
Indenting and Lists
Insert Media
Insert Items

Want to leave an answer!

Word Count :0 Draft Saved at 12:42 am.