c# Winforms can't open minimized form - c#

I have a rather large win forms project that includes a form that opens another form that includes static information for our employees while working on the other form. (I will call the form that is opened the edit form and the informational form the information form for purposes of this question) The problem that I am having is that if they happen to minimize the edit form, they must click on the minimized edit form several times to open it, each time with a ding being heard until it works. This problem is not reproducible in my development environment, but is in the deployed environments including our production and test environments. I have worked backwards commenting out stuff until it went to working, and found that when this information form is accessing the data model is when the problem happens, if I don't let the information form access the datamodel the forms will open up as expected.
Additional Information:
.Net 4.0
Information Form includes a user control
Visual Studio 2013
If anyone has any clue as to what may be causing this issue or something that may help me find this issue it would be much appreciated. I have attempted looking at process monitor to no avail.

Related

Visual Studio C# Error creating handle but built app runs fine

I have a winforms app (>75k lines of source code), I have just added some new functionality and a new form and I'm getting the 'can't create window handle' error but only when running inside VS. The app builds OK and when i run it as the executable it is using 597 handles, 94 GDI and 83 USER and the new form works just fine apart from my logic errors in it. So as far as I can tell; my app is well below the 10,000 limit where things start to break therefore the problem is in/with VS somewhere but I may have hold of entirely the wrong end of the stick or possibly completely the wrong stick.
I have cleaned, rebuilt, rebooted etc and it stills falls over.
I'm using Process Explorer (thats where the previous numbers came from) but can't seem to find VS in there to check what its total handle count is.
VS2017 on Win 11.
Yes, I have googled it and explored things to look at but I can't find a result that matches 'Studio falling over but the exe running fine', any help / pointers very much appreciated as I obviously can't debug the new form which does make things somewhat difficult.
The underlying issue was to do with a pop-up form being generated by the parent form during its load processes, I found that the parent hadn't been issued a handle before it was trying to show the pop-up. Before you ask... I'm capturing data from a network sensor via the pop-up, which, once the user has accepted the incoming value, feeds the data back to the parent form. I assume that in run-time everything runs faster and it doesn't hit that 'un-coupled' point. Changed the code in the instantiate/load/shown cycle it runs and all is well.
Thanks once again Hans, headache solved.

C# Windows Forms application hangs and need help reading the error log

After the latest release of my application, users are experiencing application "locks" where the program just remains unresponsive. This occurs at different times and never after a specific action.
At one point I found an entry in the Windows Error Logs, but I can't figure out what's happening there.
My main questions:
anyone experienced anything like this with ReportViewer in Windows Forms application?
Can someone explain the attached error log (please excuse the Dutch)
Update
Still no idea on how to fix this issue. Application keeps randomly freezing with different users. Everytime an application-hang is preceeded by the above mentioned .NET Runtime error and event 10016 (DistributedCOM). I have tried to resolve the DCOM issue by following this answer, but that did not solve the problems.
Also, I have made sure that all the forms with reportviewers (only 4) and every method that has to do with reportviewer operations have proper errorhandling.
Further explanations: from a windows form I open another form which contains a reportviewer. I show this form as a dialog.
After long inspection I found the culprit: in a new process which was started in a backgroundworker a form with a reportviewer was opened but never disposed. Closing the form and disposing it solved my issue.

designer doesn't recognise usercotrols and classes

I had a User Control start doing weird things with its events; it didn't call the load and layout events at all. I looked at the designer code and everything seemed fine. tried recreating the events in the properties windows, and still nothing.
as I didn't have this problem with other user controls i decided to delete it and make a new one with the same name. then it all went haywire - the designer of the main window suddenly stopped recognizing all the user controls and classes i've built for the project.
the design window just shows the same error repeating once for each user control or class:
Could not find type 'Project Name.Class/User Control'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.
I tried restarting the PC, rebuilding all, cleaning solution, deleting the user control that caused the kerfuffle, recreating it, and changing solution to x64 and x86.
edit: it's a windows form application.
how can i get it to work again?
It just randomly started working again. I literally haven't touched it since. but it's solved, I guess...

Why Visual Studio 2010 Form not show any text after power failure?

I am building stand alone desktop application, In development process my desktop computer is turned off due to power failure. After sometime when power is come I face a problem in which all text in form is not visible and in data gridview control show divide by zero exception some like below image:
Please Resolve my issue.
check the database is running if you are using, or try to rebuilt after close all windows

Need Suggestion for my app

I want to show an loading image when i launch my desktop application. can anybody tell me how to show this in C#? Results required as happens in visual studio 2005/2008 when we launch this application.
What you are looking for is actually a splash screen. Look at this codeproject article. It explains really well how you should do this.
http://www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx
What i did in my previous project was, that make the Form1 (display form) and make it wait for a while, then close it after that launch the Form2 which is the actual application.
But that was way back when i was a fresher. Now what i might do is, have a Form1 which ill launch and in the backgroundworker do all major UI processing work such as if any loading of data needs to be done, etc stuffs and keep every thing ready in memory. Then ill close the Form1 or make it hide or invisible and launch the Form2 which is the main app form and pass all the information required to it.

Categories