473,385 Members | 1,888 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,385 software developers and data experts.

Wait Issue

I am trying to amend someone else's code. He had a user control pop up
as modal so that the user can not access the main app till he is done
with the user control. I have had to change the form from being modal
so that the user can access help and the user control, while not
accessing the main app. The problem that I am having now is that the
previous developer had code after the userControl.ShowModal() that
needs to be done, but not till after the user is done with the user
control. How can I go about having the main app wait till the user
control is done without using ShowModal()? The code is in the session
controller between the main app and the user control and is something
like this:

Execute (UserControl UserControlName)
{
UserControlName.Show()

DialogResult dr = UserControlName.rDialogResult; // if the user preses
ok I set it = ok, etc.
if (dr = DialogResult.OK)
{
Do a bunch of stuff on the main application for based on the results
}

else
{
Quit, learn to knit, or something
}

Any idea of how to simlate a wait till the user has finished his
business with the UserControl?

Thanks,
Susan
Nov 16 '05 #1
1 1255
If you have to make it modeless, how about having the form raise an event
depending on what is clicked. You can add two events to the form, OK and
Cancel, and raise them accordingly. On the event handler, run the code that
used to appear after the call to ShowModal.

--
John Wood
EMail: first name, dot, second name at priorganize.com
"Susan" <Su***@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
I am trying to amend someone else's code. He had a user control pop up
as modal so that the user can not access the main app till he is done
with the user control. I have had to change the form from being modal
so that the user can access help and the user control, while not
accessing the main app. The problem that I am having now is that the
previous developer had code after the userControl.ShowModal() that
needs to be done, but not till after the user is done with the user
control. How can I go about having the main app wait till the user
control is done without using ShowModal()? The code is in the session
controller between the main app and the user control and is something
like this:

Execute (UserControl UserControlName)
{
UserControlName.Show()

DialogResult dr = UserControlName.rDialogResult; // if the user preses
ok I set it = ok, etc.
if (dr = DialogResult.OK)
{
Do a bunch of stuff on the main application for based on the results
}

else
{
Quit, learn to knit, or something
}

Any idea of how to simlate a wait till the user has finished his
business with the UserControl?

Thanks,
Susan

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Paul L. Du Bois | last post by:
Has anyone written a Queue.Queue replacement that avoids busy-waiting? It doesn't matter if it uses os-specific APIs (eg WaitForMultipleObjects). I did some googling around and haven't found...
3
by: Bob Dankert | last post by:
Ok, so this seems like it should be simple, and it is probably because I am so tired that I do not see the answer. How do I make a function wait for something to be set in a multi-threaded...
1
by: Huey | last post by:
Hi All, I encountered a funny thing, and my code schetch as below: #define READ 0 #define WRITE 1 int byteRead, status, pd; char buff;
3
by: Andrew Mueller | last post by:
Hello, I have the following code: DataSet myDataSet = new DataSet(); OleDbDataAdapter adapter = new OleDbDataAdapter(sb.ToString(),myConn); adapter.MissingSchemaAction =...
4
by: Pierpaolo | last post by:
hi!! Is there a function in order to wait for a time in milliseconds?? Thanks in advance
12
by: Perecli Manole | last post by:
I am having some strange thread synchronization problems that require me to better understand the intricacies of Monitor.Wait/Pulse. I have 3 threads. Thread 1 does a Monitor.Wait in a SyncLock...
40
by: =?Utf-8?B?Um9iZXJ0IEUuIEZsYWhlcnR5?= | last post by:
What is the C# command to wait for a specified period of time? I am writing a windows service that will process a file once it has beed created or changed. I'm using the fileSystemWatcher to...
21
by: puzzlecracker | last post by:
Problem: I send a lot of requests to the application (running on a different box, of course), and I receive back responses from the app . Below: socket corresponds to Socket socket=new...
1
by: bibhukdas | last post by:
Hi All, Just to elaborate on the issue. The requirement is to handle this in javascript 1. User clicks on a button 2. Change the cursor style (We are using document.body.style.cursor="wait") 3....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.