form lock or buttos disable?

Posted on 2006-05-19
Medium Priority
Last Modified: 2011-04-14
Hello Experts,
I am developing visual c#.net 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

ID: 16716051
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

Fahad Mukhtar earned 1000 total points
ID: 16716091
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

ID: 16716543
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.


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month17 days, 4 hours left to enroll

862 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