Solved

i need to delay print func

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
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 …

778 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