473,405 Members | 2,344 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,405 software developers and data experts.

Passing message/progress back to the calling form

Please help me to accomplish this.
I would like to create a sub/function that will display info & progress from
a called routine on the calling Form as follow.
Thanks a million.

Bill
---------------
Form1:

label1
progresssbar1

call Module1.Dotask()
Module1:

Function Dotask()

For each record

do something

send data back to Form1..label1
show progress on Form1.progressbar1

next

end function

Nov 21 '05 #1
2 1259
Not a good idea to do things this way as your main form (Form1) won't get a
chance to repaint properly in order to display progress. What you need is
to perform the task on a thread and use delegates to fire progress "events"
to the form.
"Bill Nguyen" <bi*****************@jaco.com> wrote in message
news:uK****************@TK2MSFTNGP15.phx.gbl...
Please help me to accomplish this.
I would like to create a sub/function that will display info & progress
from a called routine on the calling Form as follow.
Thanks a million.

Bill
---------------
Form1:

label1
progresssbar1

call Module1.Dotask()
Module1:

Function Dotask()

For each record

do something

send data back to Form1..label1
show progress on Form1.progressbar1

next

end function


Nov 21 '05 #2
Robin;

I'm new to .NET. Can you please elaborate and point me to some sample codes?

Thanks
Bill

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:d0*******************@news.demon.co.uk...
Not a good idea to do things this way as your main form (Form1) won't get
a chance to repaint properly in order to display progress. What you need
is to perform the task on a thread and use delegates to fire progress
"events" to the form.
"Bill Nguyen" <bi*****************@jaco.com> wrote in message
news:uK****************@TK2MSFTNGP15.phx.gbl...
Please help me to accomplish this.
I would like to create a sub/function that will display info & progress
from a called routine on the calling Form as follow.
Thanks a million.

Bill
---------------
Form1:

label1
progresssbar1

call Module1.Dotask()
Module1:

Function Dotask()

For each record

do something

send data back to Form1..label1
show progress on Form1.progressbar1

next

end function



Nov 21 '05 #3

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

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
3
by: rollasoc | last post by:
Hi, Having a slight problem with how to pass parameters to functions between threads. I have a form with a progress bar and a description label on it. It has a public function...
4
by: Ron Rohrssen | last post by:
I want to show a dialog and when the form (dialog) is closed, return to the calling form. The calling form should then be able to pass the child form to another object with the form as a...
17
by: LP | last post by:
Hello, Here's the scenario: Object A opens a Sql Db connection to execute number of SqlCommands. Then it needs to pass this connection to a constructor of object B which in turn executes more...
4
by: Raed Sawalha | last post by:
Dear, I have windows form , the form is using a class to do all tasks needed like this private void btnProcess_Click(object sender, System.EventArgs e) { btnProcess.Enabled = false;...
11
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
5
by: manningfan | last post by:
I have a single form that I want to make as generic as possible. The form contains a Calendar control. Using OpenArgs I pass values from the form that's calling the calendar, and the field the...
6
by: Terrance | last post by:
Hello, everyone I'm new to C# and I was wondering if someone can tell me how do I pass a value from 1 form back to the calling routine. What I mean is in my Parent form I have this code: private...
9
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my...
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: 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
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
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
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.