.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Capture ScreenShot using VB.NET

Posted By:Hefin Dsouza       Posted Date: August 24, 2009    Points: 10    Category: Windows Form Controls    URL: http://www.dotnetspark.com  
 

This Code sample will allow you to easily and quickly capture screenshot.and display the captured image in a picturebox.

This code is simple enough to understand.

Private Sub CapTureScreenShot(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send("{%}({PRTSC})")
System.Threading.Thread.CurrentThread.Sleep(500)
Beep()
Me.Show()
PictureBox1.Image = CType(My.Computer.Clipboard.GetImage, Image)
Me.WindowState = FormWindowState.Normal
Timer1.Stop()
Timer1.Enabled = False
End Sub


The PRTSC is the KeyCode the SendKeys.Send method accepts.

Regards
Hefin Dsouza


     

Further Readings:

Responses
Author: Nabin         Company URL: http://www.dotnetspark.com
Posted Date: September 03, 2009

hi,

can u give the same code in C#.net please....

thanks
Nabin

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend