Common Function to Check the TextBox is blank or not

Posted by Chikul under VB.NET category on | Views : 2740
'Parameter : Textbox, & TextBox Description
'Output : Returns False, Popup the Message like "Name Can Not Be Blank."
    Shared Function ChkBlank(ByVal CTxt As TextBox, ByVal CTxtNam As String) As Boolean
If Len(CTxt.Text.Trim()) > 0 Then
CTxt.Text = UCase(CTxt.Text)
Return True
MessageBox.Show(CTxtNam & " Can Not Be Blank", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return False
End If
End Function

Comments or Responses

Login to post response