Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 27th, 2010  |  syntax: VB.NET  |  size: 0.37 KB  |  hits: 114  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Public Class Form1
  2.  
  3.     Private Sub txtName_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtName.Validating
  4.  
  5.         If txtName.Text.Trim() = String.Empty Then
  6.             epName.SetError(txtName, "You cannot leave this blank.")
  7.         Else
  8.             epName.Clear()
  9.         End If
  10.  
  11.     End Sub
  12.  
  13. End Class