473,396 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can't click button on form during function call in C#

I am developing a program in C# Visual Studio and I have a form that is created when a button is clicked on another form. This new form comes up and immediately, a function is called and executed from the load function. After the function is done, the form is closed. I have a 'Cancel' button on the form so the user can have the option cancel the function, but the button can't be clicked while the form is visible. How can I fix this problem?
Oct 23 '07 #1
3 2258
Plater
7,872 Expert 4TB
Are you using .ShowDialog() to show that form? If so, it's a blocking call and you willwant to use .Show() instead.

Another possibility is that it's running in the same thread and it is too busy performing your function to handle your request.
Oct 23 '07 #2
I am using .Show(). Is there any way to avoid the other?
Oct 23 '07 #3
Plater
7,872 Expert 4TB
Run it in a new thread?
It would be trickier to tell it to "cancel" then (outside of killing the thread)
Oct 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
4
by: BluDog | last post by:
Hi I am trying to test dynamically created controls, to do this i have added a placeholder to a WbForm and added the following code behind: Private Property Count() As Integer Get If...
1
by: rmgalante | last post by:
I have written an ASP.Net application that uses the standard client-side and server-side validation for various fields on the form. Some of the customers that use the form report symptoms that...
6
by: Kylin | last post by:
Public Class test1 Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private...
4
by: Mark Miller | last post by:
I've been trying to execute a javascript function just before submit on a form that contains an <input type="file"> input field and it isn't working. The reason I want to do this is the end users...
17
by: nicolas.hilaire | last post by:
Hi all, i'm doing a quite long treatment in a function, and i'm showing the progress of the treatment with a progressbar. The code is something like this : for each(entry in entries) // about...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
5
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
5
by: dwmartin18 | last post by:
Hello everyone. I have quite the puzzling problem with a script I have been working on lately. I have created a function that can be called to create a new html element (e.g. input, select, div,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.