You are on page 1of 3

Imports System.Data.

SqlClient Public Class Form1 Dim con As SqlConnection Dim com As SqlCommand Load: Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click OpenFileDialog1.ShowDialog() TextBox2.Text = OpenFileDialog1.FileName Me.PictureBox1.BackgroundImage = New System.Drawing.Bitmap(TextBox2.Text) End Sub View: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim rd As SqlDataReader com.CommandText = "select * from picture" rd = com.ExecuteReader() While rd.Read If TextBox1.Text = rd(0).ToString Then 'Me.PictureBox1.Size = New System.Drawing.Size(500, 500) Me.PictureBox1.BackgroundImage = New System.Drawing.Bitmap(rd(1).ToString) rd.Close() Exit Sub End If End While MsgBox("PID NOT FOUND") rd.Close() End Sub Save: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click com.CommandText = "insert into picture values('" & TextBox1.Text & "','" & TextBox2.Text & "')" com.ExecuteNonQuery() MsgBox("Stored") End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con = New SqlConnection com = New SqlCommand con.ConnectionString = "Data Source=.;Initial Catalog=pic;Integrated Security=True" con.Open() com.Connection = con End Sub

Zoom: Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click 'If Button4.Text = "ZOOM OUT" Then ' Button4.Text = "ZOOM IN" 'Else ' Me.PictureBox1.Size = New System.Drawing.Size(200, 200) ' Button4.Text = "ZOOM OUT" 'End If End Sub Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click If PictureBox1.Width = 200 Then Me.PictureBox1.Size = New System.Drawing.Size(500, 500) Exit Sub End If If PictureBox1.Size.Width = 500 Then Me.PictureBox1.Size = New System.Drawing.Size(200, 200) End If End Sub End Class Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Of1.InitialDirectory = "F:\" Of1.ShowDialog() player.URL = Of1.FileName player.Ctlcontrols.play() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click player.Ctlcontrols.pause() End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click player.Ctlcontrols.play() End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click player.Ctlcontrols.stop() End Sub Private Sub op_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles op.Click Of1.ShowDialog() pdf.LoadFile(Of1.FileName) End Sub End Class

You might also like