Solved

i need to delay print func

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

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

738 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