minimize, maximize buttons on the top,right hand corner of my form

J

jj

I have a single threaded application in c# that scans through a file system.
While doing this if I try to minimize, maximize buttons on the top,right
hand corner of my form do not do as they are supposed to do. To maximize the
window I have to go to "task manager" and double click the application.

How do I control those maximize, minimize buttons on the top right section
of my form?


A learner here
Thanks
 
M

Mattias Sjögren

I have a single threaded application in c# that scans through a file system.

Why don't you do the work on a background thread to keep your UI
responsive?


Mattias
 
G

Guest

Hi jj,
the control box buttons should work without any intervention from you. I
suspect that they work before you start your scan (not mentioned) and after.
This probably means that you are doing a lot of intensive processing in the
main UI thread which is in charge of handling UI requess. The main UI thread
does not get chance to process the UI messages while your intensive
processing is going on so the UI becomes unresponsive. The solution is to
move your processing in to a new thread, not the main UI thread, this way the
main UI thread is still free to handle requests during the intensive
processing. For a great tutorial on this check out:

http://www.yoda.arachsys.com/csharp/threads/winforms.shtml

This should answer all of your questions.

Hope that helps
Mark Dawson
http:/www.markdawson.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top