Jump to content

Base de Dados


jviana
 Share

Recommended Posts

Olá Malta Tenho uma Dúvida:

Tenho um projecto que contém uma Base de dados, listview. Botão Adicionar.

O botão funciona da perfeição adiciona e faz tudo mas gostava que no projecto houvesse um botão que tipo "guardava tudo".

Alguém tem alguma ajuda de como fazer??

Vou mandar os códigos (tenho isto a passar da form2 para form4):

Public Class Form2
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim F2 As New Form4
        AddHandler F2.MandarDados, AddressOf ChegaramDados
        F2.ShowDialog()
        RemoveHandler F2.MandarDados, AddressOf ChegaramDados
        F2.Dispose()
    End Sub
    Private Sub ChegaramDados(ByVal Tx1 As String, ByVal Tx2 As String, ByVal Tx3 As String, ByVal Tx4 As String)
        Dim LVI As New ListViewItem
        LVI.Text = Tx1
        LVI.SubItems.Add(Tx2)
        LVI.SubItems.Add(Tx3)
        LVI.SubItems.Add(tx4)
        ListView1.Items.Add(LVI)
    End Sub
End Class

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Public Class Form4

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        RaiseEvent MandarDados(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text)
        Me.Close()
    End Sub

    Public Event MandarDados(ByVal Tx1 As String, ByVal Tx2 As String, ByVal Tx3 As String, ByVal Tx4 As String)
End Class

Learning

  • VB.Net
  • HTML
  • C/C++

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.