form lock or buttos disable?

Posted on 2006-05-19
Last Modified: 2011-04-14
Hello Experts,
I am developing visual application for win mobil 2003 se.
In my application I have a connect button which connect to the server through GPRS to get reent records and updates. The whole process runs good and i have a timer which do the same process  automatically every 2 minuts.
The problem is when i connect to the server manually or in every 2 minuts when the system do the connetion the interface is blocking all the time and when someone clicks another the button( you know about the users if thery do not get any immediate feedback they click click click ) and the system blocks forever.

I need a method to frees the whole screen to disable all the button process.
after the server connection process ( 3 or 4 seconds ) the system should come active for the user.

Now i have a solution to put another form in fornt of the main form to say the system is bussy. It comes automatically and disapiers after the connection process. But every 2 minutes it comes and the user is not happy with it.

Do anybody have any idea to solve this porblem.

Thanks in advance.

Hope to hear.
Question by:Ludo_Dirckx
    LVL 44

    Expert Comment

    Hello Ludo_Dirckx,

    in the first timer tick
    1. you can trigger a second timer that disables the buttons
    2. set the interval to x seconds [to retrieve the data]
    3. when it comes in its own tick it disables itself and enables the buttons again

    this is just an idea not sure if its feasible

    LVL 19

    Accepted Solution

    You can use this method to disable/enable all the buttons on a form

         private void EnableDisableButtons(bool enable)
                foreach (Control c in this.Controls)
                    if (c is Button)
                        c.Enabled = enable;

    Author Comment

    Hi Bruintje, Desp
    thanks for the speed reply.
    i feel more confortable with Desp's answer.
    I will work on it and let you know how it works.

    Perfect answer desp. I appreciate that.
    It works perfect.

    thank you.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now