Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validating Ocx control
Message
De
02/12/2004 19:37:28
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Validating Ocx control
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
00966584
Message ID:
00966584
Vues:
48
i need to validate an ocx control which has a "validar" method that returns true or false, if i trie to validate from validating's event of the control it ignores the validation and allows to leave the control with invalid data, if i move the code to a button and in that case it performs the validation,here is my code.

thank's in advance
'this code does not work i can leave control with invalida data
Private Sub txtcuit_Validating(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles txtcuit.Validating

If Me.txtcuit.Validar = False Then

MsgBox("error")

e.Cancel = True

End If

End Sub


'This code works it detects invalid data and send back to the control
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

If Me.txtcuit.Validar = False Then

MsgBox("error")
Me.txtcuit.focus()

End If

End Sub
Répondre
Fil
Voir

Click here to load this message in the networking platform