?
Solved

Conditions

Posted on 2012-03-24
4
Medium Priority
?
284 Views
Last Modified: 2012-03-24
How to limit the character of a TextBox?

private void mds_Click(object sender, RoutedEventArgs e)
{
   If (iText.Text Character?? >= 12 character)
   {
       MessageBos.Show("Wrong Entry");
   }
   
}
0
Comment
Question by:Whing Dela Cruz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Assisted Solution

by:JAruchamy
JAruchamy earned 1000 total points
ID: 37762083
0
 
LVL 14

Accepted Solution

by:
nishant joshi earned 1000 total points
ID: 37762108
private void mds_Click(object sender, RoutedEventArgs e)
{
   If (iText.Text.Length() >= 12 character)
   {
       MessageBox.Show("Wrong Entry");
   }
    
}

Open in new window


Regards,
nishant
0
 
LVL 15

Expert Comment

by:Navneet
ID: 37762137
Hi!

You can set MaxLength propery of textbox
<TextBox MaxLength="12 />


Thanks!
0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 37762140
Thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question