Solved

i need to delay print func

Posted on 2008-10-30
4
204 Views
Last Modified: 2012-05-05
hi there ,
i have in my code 2 func that print reports
i want to delay them in 3 sec from 1 to 2 func
the first func there is no need to delay only the 2

thanks ....
try 

			{

				InsNewHes();

                                     HesMange.HesMan.PrintMerakzen(Hnum); // delay this print command in 3 sec

              

				

			}

			catch (Exception r)

			{

				MessageBox.Show(r.Message);
 

			}

            try

            {
 

                HesMange.HesMan.UpdateMakor(Hnum);
 

                int copys = Int32.Parse(comboBox1.Text);

                for (int i = 0; i < copys; i++)

                    HesMange.HesMan.PrintMerakzen(Hnum); // delay this print command in 3 sec
 

                this.Close();
 

            }

            catch (Exception r)

            {

                MessageBox.Show(r.Message);

                this.Close();

            }

Open in new window

0
Comment
Question by:Tech_Men
  • 2
4 Comments
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 200 total points
ID: 22843609
use the Sleep() function
System.Threading.Thread.Sleep(3000);
0
 

Author Comment

by:Tech_Men
ID: 22843634
where
cau u type it in my code ?
0
 
LVL 15

Accepted Solution

by:
SRigney earned 300 total points
ID: 22843938
Your comment in the code shows that you wanted to delay the first one as well, so I put it there too.
try 

{

	InsNewHes();

	System.Threading.Thread.Sleep(3000); 

	HesMange.HesMan.PrintMerakzen(Hnum); // delay this print command in 3 sec

}

catch (Exception r)

{

	 MessageBox.Show(r.Message);

}
 

try

{

	HesMange.HesMan.UpdateMakor(Hnum);
 

	int copys = Int32.Parse(comboBox1.Text);

  for (int i = 0; i < copys; i++)

  {

		System.Threading.Thread.Sleep(3000);

		HesMange.HesMan.PrintMerakzen(Hnum); // delay this print command in 3 sec

	}

 

	this.Close();

 

}

catch (Exception r)

{

	MessageBox.Show(r.Message);

	this.Close();

}

Open in new window

0
 

Author Closing Comment

by:Tech_Men
ID: 31511775
thanks ...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to get a file from SqlServer DB 4 29
Duplicate a row 2 33
Throws error on Decrypting String c# code 3 27
cs.Designer Issue 2 20
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now