TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Israel
700
1.3k
217.5k
Its doenst clean my textbox? What happen?
Dec 5 2014 3:30 PM
Hi!
I write this code to start always with a capital letter in my textbox. its works!
But what happen? When I click on my button to clean my textbox (or combobox). I receive this message:
Index
was outside the bounds of the array.
What happen?
Code to have the first capital letter:
private void txtdesignation_TextChanged(object sender, EventArgs e)
{
char[] v = txtdesignation.Text.ToCharArray();
string s = v[0].ToString().ToUpper();
for (int b = 1; b < v.Length; b++)
s += v[b].ToString().ToLower();
txtdesignation.Text = s;
txtdesignation.Select(txtdesignation.Text.Length, 0);
}
Code to clean my textbox:
txtdesignation.Text = "";
Reply
Answers (
6
)
Encrypt and Decrypt Passwords in SQL Server 2008.
Want To Register User Control in multiple aspx pages