473,396 Members | 2,030 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.

Passing message between forms

Jim
I've got a Main Form that takes a list of files. You click the "Process
Button", it then opens a new "Batch" form which processes the images files
one at a time. Unfortunatley the process takes a bit of time but my code
keeps running, not waiting for the batch to get done. How can I have the
"Main" form wait until the Batch form is finished with it's job, before the
"Main" form sends another job to the "Batch" form?

Sorry for being so wordy.. Still trying to get my mind around this problem.

For Example:

processBatchList()
{
for (batchLoop = 0; batchLoop <= numberOfRowsInDataGrid; ++batchLoop)
{
try
{
// Use Multidimensional Array
string imageFilePath = processImageQue[batchLoop, 0];
string imageFileSaveLocation = processImageQue[batchLoop, 1];
BatchForm processImage = new BatchForm(imageFilePath,
imageFileSaveLocation);
processImage.Show();
}
catch
{
// Handle the error
}
}
}
When the try happens how can I make it wait for a message back from the
processImage instance of BatchForm? And how would I send back a message
from BatchForm?

thanks,
jim
Nov 15 '05 #1
2 1582
> How can I have the
"Main" form wait until the Batch form is finished with it's job, before the "Main" form sends another job to the "Batch" form?


It sounds like your "Batch" form isn't really a form but a process. If
that's the case look at this sample:

Multithreaded Windows Forms Control Sample
ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpcondevelopingmultithreadedwindows
formscontrol.htm

Nov 15 '05 #2
Maybe instead of .Show() use the .ShowDialog() method to have a modal
form displayed ?

And so the loop is beeing waiting for it to self close before
continuing...
Cybertof.
In article <#R*************@TK2MSFTNGP11.phx.gbl>,
tr**********@yahoo.com says...
I've got a Main Form that takes a list of files. You click the "Process
Button", it then opens a new "Batch" form which processes the images files
one at a time. Unfortunatley the process takes a bit of time but my code
keeps running, not waiting for the batch to get done. How can I have the
"Main" form wait until the Batch form is finished with it's job, before the
"Main" form sends another job to the "Batch" form?

Sorry for being so wordy.. Still trying to get my mind around this problem.

Nov 15 '05 #3

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

Similar topics

8
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
9
by: Max | last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong here as I'm not able to pass a simple variable to a function. In the head of doc I have: <script...
3
by: SV | last post by:
Dear all, In my application I have a lot of hidden fields. I want to make them invisible for the users though for debugging reasons I want to make them visible. So I want to add these objects to...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
5
by: Rod | last post by:
I've written 2 ASP.NET applications (I've worked on one with a team and another by myself). In my ASP.NET pages, when saving data to a backend database I've done it by using the click event of a...
6
by: RBCC | last post by:
Public Class fraction Dim m_numerator As Int16 Dim m_denominator As Int16 Public Event zerodenom() Public Property numerator() As Int16 Get Return m_numerator
7
by: The Doctor | last post by:
A rather elementary question, In VB5, how can I pass a variable from one form to another?
2
by: Carl Heller | last post by:
Working in VS2003, .Net 1.1 I'm working on a project where I compare data between two databases. This is a lengthy process, and very data intensive, so I decided to create a class, and thread...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.