Tutorials on visual basic 2008, Manuals on visual basic 2008 - all projects include visual basic project file source codes! Visual Basic 2008 Tutorial. Easy Programs done on VB 2008
Thursday, July 5, 2012
Screen Capture Program Using Visual Basic 2008
Design
Running
You will need the following:
* 3 Buttons
* 1 Image Box
* 2 Timers
* 1 Save Dialog
Program Codes :
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Opacity = 0
Me.WindowState = FormWindowState.Minimized
Me.Text = "Please Wait..."
Me.Text = "Taking Picture"
Timer2.Enabled = True
Timer1.Enabled = True
Label1.Visible = False
Me.Size = New Size(602, 400)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim savefiledialog1 As New SaveFileDialog
Try
savefiledialog1.Title = "Save File"
savefiledialog1.FileName = "Screen"
savefiledialog1.Filter = "JPEG |*.jpg"
If savefiledialog1.ShowDialog() = DialogResult.OK Then
PictureBox1.Image.Save(savefiledialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
End If
Catch ex As Exception
'Do Nothing
End Try
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
PictureBox1.Image = Nothing
Label1.Visible = False
Me.Size = New Size(602, 71)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Opacity = 100
Me.WindowState = FormWindowState.Minimized
Me.WindowState = FormWindowState.Normal
Timer1.Enabled = False
Me.Text = "Screen Capture"
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim bounds As Rectangle
Dim screenshot As System.Drawing.Bitmap
Dim graph As Graphics
bounds = Screen.PrimaryScreen.Bounds
screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
graph = Graphics.FromImage(screenshot)
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
PictureBox1.Image = screenshot
Timer2.Enabled = False
Label1.Visible = True
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
End Sub
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
Process.Start("http://vb2008tutorialz.blogspot.com/")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Labels:
2008,
basic,
capture,
coding,
help,
information,
programming,
screen,
simple,
system,
tutorials,
visual
Batch File Maker Using Visual Basic 2008
Desing
Running
You will need the following:
*1 Rich Text Box
* 1 Menu Strip
* 1 Save Dialog
Program Codes :
Public Class Form1
Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
Try
PictureBox1.Visible = True
Dim dlg As SaveFileDialog = New SaveFileDialog
dlg.Title = "Save Batch File"
dlg.Filter = "Batch File (*.bat)|*.bat"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.SaveFile(dlg.FileName, RichTextBoxStreamType.PlainText)
End If
Catch ex As Exception : End Try
PictureBox1.Visible = False
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
RichTextBox1.Clear()
End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
MsgBox("Batch File Maker Created By Roatan Softwares")
End Sub
Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
Try
PictureBox1.Visible = True
Dim dlg As SaveFileDialog = New SaveFileDialog
dlg.Title = "Save Batch File"
dlg.Filter = "Batch File (*.bat)|*.bat"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.SaveFile(dlg.FileName, RichTextBoxStreamType.PlainText)
End If
Catch ex As Exception : End Try
PictureBox1.Visible = False
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
RichTextBox1.Clear()
End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
MsgBox("Batch File Maker Created By Roatan Softwares")
End Sub
Labels:
2008,
basic,
batch,
coding,
file maker,
information,
programming,
simple,
system,
tutorials,
visual
Subscribe to:
Posts (Atom)