Solved

i need to delay print func

Posted on 2008-10-30
4
207 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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