1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
Public Class Form1
Private Sub ComposantsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComposantsBindingNavigatorSaveItem.Click
Me.Validate()
Me.ComposantsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.ELiquidesDataSet)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: cette ligne de code charge les données dans la table 'ELiquidesDataSet.Composants'. Vous pouvez la déplacer ou la supprimer selon vos besoins.
Me.ComposantsTableAdapter.Fill(Me.ELiquidesDataSet.Composants)
End Sub
Private Sub Bt_UploadPic_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Bt_UploadPic.Click
' Create an instance of the open file dialog box
' Dim OpenFileDialog1 As New OpenFileDialog
With OpenFileDialog1
.CheckFileExists = True
.ShowReadOnly = False
.Filter = "JPEG Files (*)|*.jpg;*.png;*.bmp;*.gif"
.FilterIndex = 2
If .ShowDialog = DialogResult.OK Then
' Load the specified file into a PictureBox control.
PictureBox1.Image = Image.FromFile(.FileName)
PhotoPictureBox.Image = Image.FromFile(.FileName)
End If
End With
End Sub
Private Sub Bt_AddNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt_AddNew.Click
' Bouton = Nouvelle Entrée
ComposantsBindingSource.AddNew()
End Sub
Private Sub Bt_Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt_Save.Click
' Bouton = Save
Try
Me.Validate()
Me.ComposantsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.ELiquidesDataSet)
' Me.ComposantsTableAdapter.Update(Me.ELiquidesDataSet.Composants)
MessageBox.Show("MDB Saved")
Catch ex As Exception
MessageBox.Show("Error - MDB Not Saved")
End Try
End Sub
End Class |
Partager