[RESOLVED] Shutdown error due to Unshown form
My winforms application consists of multiple forms, but the user is only presented with one form at a time.
In the background, the application might be using functions and procedures from other forms.
The issue is, one of these background forms is preventing my system shutdown by throwing error. The form in question here, was not presented(.shown() not done).
I tried finding the root cause of the issue, but could not find anything relevant.
Is anyone aware about why an unshown form is receiving WM_QUERYENDSESSION from the os?
Re: Shutdown error due to Unshown form
Why are you architecting your system like this? If you have shared code that needs to be accessed without initializing some sort of variable then you should setup a module or class with shared methods.
Re: Shutdown error due to Unshown form
The hidden form has some code that operates based on values of some UI componenets, like textbox values, DataGrid Content etc. Due to lack of time and the business requirement, logic and UI separation was not done, and we had to continue maintaining the code in same manner. Hence, the hidden form logic is being used.
Re: Shutdown error due to Unshown form
Quote:
Originally Posted by
IT_Researcher
The hidden form has some code that operates based on values of some UI componenets, like textbox values, DataGrid Content etc. Due to lack of time and the business requirement, logic and UI separation was not done, and we had to continue maintaining the code in same manner. Hence, the hidden form logic is being used.
You have to fix it one way or another. Might as well fix it properly…