Red Cross issue on MenuStrip and ToolStrip

I have a piece of software that works fine on many machines, although on one machine there is a problem that occurs, sometimes, MenuStrip and ToolStrip appear as an empty white background with a red cross on it, since the user control will be if You have created a null object. This does not happen while I am debugging, and I do not know how to re-issue the problem, but it does. I was wondering if anyone knows what might be the problem?

Will it be a version of the .NET framework?

thanks

+4
source share
5 answers

This is a common occurrence when the problem of GDI + ("Red X Death") occurs. Are you doing any custom drawing in OnPaint ? Or, perhaps there is a graphic resource or glyph that is damaged or misused.

Edit: I re-read your question. It seems that you have it on only one of the machines. I worked a little on this and I stumbled upon this old thread . The message below shows that there may be a problem with disabling virtual memory:

We managed to solve this - we were seeing a problem on the built-in XP device. The XPe image developer turned off virtual memory, and as soon as we included it in the problem, he left. I believe that this is just a symptom of a system running out of memory to display graphics (perhaps especially if you use a lot of double buffering)

Hope this helps.

+3
source

Sounds like a symptom of Out Of Memory Exception to me.

Edit: Sometimes this can lead to a System.InvalidOperationException: BufferedGraphicsContext

+2
source

Are you trying to update GUI controls from a thread other than a GUI thread? Combine the cross-thread operation with an exception handler that swallowed everything, and we had the behavior that you describe (in the grid control, not in the menustrip panel) in the application that I supported.

+1
source

Definitely sounds like a crossflow problem.

Make sure you use Invoke when accessing controls and / or triggering events from a thread that is not the main user interface thread.

+1
source

Seeing this on one computer more than 1000, which has our pride. On this computer, I see that the .NET 3.5 program sometimes shows a red X on its datagrid. And another simpler .NET 2.0 program got a red X in its Strip menu. I only have the source code for a simpler program, but I can say that there is no user code that affects this component. There is no cross-flow because nothing updates it. This content is set during development with the addition of one element to it when the program loads. The Red X error was successful after downloading the program.

I was very surprised to see the problem in two different frames and in one program that is not data-bound. I really hope that the computer turns off its virtual memory.

If this is not the case, then any guidance on system components that are shared in .NET 2.0 and .NET 3.5 will be appreciated.

Update: a user with a problem abandoned the computer and replaced it (which solved the problem)

+1
source

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


All Articles