Validating event visual basic

If I try to close the form without putting a number in, it calls the validate event and pops up my Msg Box. This handles it, but I forgot if it was e.cancel= true or e.cancel=false take a look what it is in your situation. This handles it, but I forgot if it was e.cancel= true or e.cancel=falsetake a look what it is in your situation. Cor Cor, The problem is that I also have a closing event.

validating event visual basic-89

Cor -----Original Message-----Hi Eric There was a good sollution in this newsgroup from Jeffrey Tan, Someone cleaned it up.

There stayed another sollution from Jeffrey, describes the problem good, butgives not such a nice sollution.

Sorry for you, I d' nt have it now and d'nt remember it exact and I said to someone to look something over before, so I do that first.

I placed Jeffreys name in the subject, maybe he sees it and has it still so he can repost it.

You should always use the Validating event, it was made to support validation.

If not to prevent the focus change then at least for the Causes Validation property.

Index Of("@")) Then error Message = "" Return True End If End If error Message = "Email address must be valid email address format." Control Chars. Validating Dim error Msg As String If Not Valid Email Address(text Box1. Active Control property to the current form, focus events occur in the following order: argomento nella sezione "riferimento all'input da tastiera" e la sezione "deadlock dei messaggi" dell'argomento "informazioni sui messaggi e sulle code di messaggi" in MSDN Library all'

Active Control proprietà sul form corrente, gli eventi di attivazione si verificano nell'ordine seguente: When you change the focus by using the keyboard (TAB, SHIFT TAB, and so on), by calling the Select or Select Next Control methods, or by setting the Container Control.

Length) ' Set the Error Provider error with the text to display. Set Error(text Box1, error Msg) End If End Sub Private Sub text Box1_Validated(By Val sender As Object, _ By Val e As System. Validated ' If all conditions have been met, clear the error provider of errors. Set Error(text Box1, "") End Sub Quando si modifica lo stato attivo usando la tastiera (TAB, MAIUSC TAB e così via), chiamando i Select metodi o Select Next Control oppure impostando la Container Control.

Tags: , ,