Ciao a tutti ho un problema per richiamare un evento c'è qualcuno che può darmi una mano?
Private Sub txtCodice_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtCodice.Validating
If txtCodice.Enabled Then
Dim Db As New ElaboraDati(mStringConn)
Try
With Db.Seleziona("SELECT * FROM Articoli WHERE IdArticolo='" & txtCodice.Text & "'", "Articoli")
If .Rows.Count > 0 Then
txtDescrizione.Text = .Rows(0).Item("Descrizione")
txtCosto.Text = Format(.Rows(0).Item("Costo"), "Currency")
txtQta.Text = .Rows(0).Item("Quantita")
txtCodice.Enabled = False
IsChange = False
Else
txtDescrizione.Text = ""
txtCosto.Text = Format(0, "Currency")
txtQta.Text = 0
End If
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
Il chiamante:
Private Sub dgElenco_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgElenco.DoubleClick
txtCodice.Text = dgElenco.Item(dgElenco.CurrentRowIndex, 0)
AddHandler txtCodice.Validating, AddressOf txtCodice_Validating
End Sub
Praticamente al mometo che arriva alla chiamata non passa all'evento c'è qualcosa che mi sfugge e non riesto a capire dove.![]()
Ciao a tutti e grazie![]()

Rispondi quotando