473,804 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.progressb ar1

next

end function

Nov 21 '05 #1
2 1288
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******** ********@TK2MSF TNGP15.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.progressb ar1

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************ *************@r eallyidont.com> wrote in
message news:d0******** ***********@new s.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******** ********@TK2MSF TNGP15.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.progressb ar1

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
14960
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) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
3
8055
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 IncrementProgressBar() that just calls performstep on the progress bar.
4
4872
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 parameter. For example, FormOptions formOptions = new FormOptions(); if (formOptions.ShowDialog(this) == DialogResult.OK) {
17
9395
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 commands on the same connection. I have an understanding that if SqlConnection is passed as "value" (unboxed), object B will create its own copy of SqlConnection, so when object A closes its connection, it remains open for object B's copy. Is this
4
13004
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; MailBoxRenamer oMailBox = new MailBoxRenamer(); //How Can i make the progress bar moving while rename processing is underway pBarCtrl.Visible = true; oMailBox.RenameAll();
11
8134
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 number) which is the last line of the following sub routine: ' procedure modifies elements of array and assigns ' new reference (note ByVal) Sub FirstDouble(ByVal array As Integer()) Dim i As Integer
5
7979
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 calendar should write to. I do this so I can use the same calendar form throughout my database. Does anyone know how to pass this info back to the form that called it? I'm trying to set the value of the control on a form using a Submit button...
6
4531
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 void frmParent_Load(object sender, EventArgs e) { //When the form loads show the login prompt for the user to login. Form loginForm = new frmLogin(); loginForm.ShowDialog();
9
3274
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 problem occurs when i try to show a progress bar. The screen freezes. I know i'm not the first one to ask about it. but i'm looking
0
9595
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10354
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7643
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.