Solved

Conditions

Posted on 2012-03-24
4
278 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
4 Comments
 
LVL 2

Assisted Solution

by:JAruchamy
JAruchamy earned 250 total points
Comment Utility
0
 
LVL 14

Accepted Solution

by:
nishant joshi earned 250 total points
Comment Utility
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:navneethegde
Comment Utility
Hi!

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


Thanks!
0
 

Author Closing Comment

by:Whing Dela Cruz
Comment Utility
Thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now