Solved

i need to delay print func

Posted on 2008-10-30
4
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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