Solved

i need to delay print func

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

863 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

22 Experts available now in Live!

Get 1:1 Help Now