Tutorials
Resources
Forum
Reviews
Communities
Interview
Jobs
Projects
Training
Your
Ad
Here
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Lobby
|
Gift Shop
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
srinivas kante...
(67)
Alwyn
(63)
Abhisek Panda
(42)
Last 7 Days
Alwyn
(727)
nishithraj
(512)
Gaurav Arora
(503)
more...
Resources
»
Code Snippets
»
C# Syntax
»
Textbox validation - Allows Only Letters
Posted Date: 12 Dec 2008
Resource Type:
Code Snippets
Category:
C# Syntax
Author:
KR
Member Level:
Gold
Rating:
Points
: 5
C# Win Forms:
------------------
The following steps allows the user to enter only letters (a to z/ A to Z),
-> Drag and drop textbox from toolbox to form
-> Register Textbox KeyPressEvent
Code:
--------
Using System;
using System.Windows.Forms;
using System.Text;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// Textbox KeyPress event block
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
// Allows only letters
if (!(Char.IsLetter(e.KeyChar) || Char.IsControl(e.KeyChar)))
e.Handled = true;
}
}
}
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
Textbox Validation
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Inserting image into database & retriving from database.
Previous Resource:
Textbox validation - Allows Only Alpha-Numeric’s (C# Win Forms)
Return to Discussion Resource Index
Post New Resource
Category:
C# Syntax
Post resources and
earn money
!
More Resources
Types of Assemblies in C#
function with more than one return value
Difference between Call by value & Call by reference
Textbox validation - Allows Numeric’s (0 to 9) Only (C# Win Forms)
C# coding for Salary calculation
Display information about directories contents within a web page
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use