.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Validations >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Common Function to Check the TextBox is blank or not

Posted By:Prasanti Prusty       Posted Date: December 16, 2009    Points: 10    Category: Validations    URL: http://www.dotnetspark.com  
 

Common Function to Check the TextBox is blank or not

'Parameter : Textbox, & TextBox Description
'Output : Returns False, Popup the Message like "Name Can Not Be Blank."


Code :

    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
Else
MessageBox.Show(CTxtNam & " Can Not Be Blank", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Warning)
CTxt.Focus()
Return False
End If
End Function

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend