Winforms preload using stack and hidden form

I am currently working on a project in which we have a couple of very powerful user controls that are used inside an MDI controller. This application is for business applications and it is data driven.

The problem we were facing was that the above controls would load very slowly, we immersed our fingers in multithreading waters for the control load, but this was not a solution for many reasons. Our decision to increase the performance of controls resulted in preloading the forms in a hidden window, creating a stack of existing forms, and removing the stack when the user requested the form.

Now the current problem that I see will arise as we push this “fix” to our testers, and ultimately our users:

Currently, a hidden window containing pre-loaded forms is displayed in the task manager and can be disabled, which will lead to the loss of all controls. Then you have to create them on the fly, losing productivity. Secondly, when the user uses the stack, we lose performance increase (the current solution to this is discussed below).

For the first problem, is there a way to hide this window from the task manager, perhaps by creating a parent form that encapsulates both the main form for the program and the hidden form?

Our current solution to the second problem is an inactivity timer, when it runs stack checks for forms and loads a new form onto the stack if it is not populated. However, this can still cause the user interface to freeze when it creates forms. Possible solutions for this would be to put the “used” forms back on the stack, but I feel that there might be a better way.

EDIT: to explain the control structure

From the comments, I realized that there is no clarity on what exactly this control does.

Here is a detailed explanation of one of the controls.

I defined for this control load time as the time it takes when the user performs an action that opens the control until the control is available for editing.

, 5 , 180 . , , Child MDI ( DevExpress). , "" ( ), . , , :

.   , .   . , 2   .   .

, 10 , , 85 - 95 .

2 , 0,8 , .

, .

: ?

+3
4

" " , , .

" "?

.NET, , , , .Visible .MDIParent .

, , , .

? ?

+2

12 Windows Forms
http://devcomponents.com/blog/?p=361

... . .

, , , , SELECT , , . ; , , . ; , , .

, 80% 90% 10-20% . , , .

+3

For the taskbar, winforms has a property called "ShowInTaskBar". Set to false. As for streaming processing, all your data manipulations should be on it your own thread / threads. Also not sure if this will help, but there is a doublebuffering property in the form.

+1
source

Can you just load the control at the beginning of the application and make it visible / invisible every time you need it? also clean it ???

0
source

Source: https://habr.com/ru/post/1748024/


All Articles