469,353 Members | 2,061 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,353 developers. It's quick & easy.

Change ListBox Items to Uppercase or Lowercase in C#.Net

Hi, I have so many items in a listbox (strings such as Apple, Orange, Grapes..etc) and I want to change these to Uppercase and Lower case.
Please anybody tell how this is possible in C#.Net

Thanks in Advance,
softengg, UK
Jun 21 '07 #1
2 8428
nateraaaa
663 Expert 512MB
Hi, I have so many items in a listbox (strings such as Apple, Orange, Grapes..etc) and I want to change these to Uppercase and Lower case.
Please anybody tell how this is possible in C#.Net

Thanks in Advance,
softengg, UK
You should be able to loop through the ListBox and change each item to uppercase using .ToUpper().

Expand|Select|Wrap|Line Numbers
  1. foreach(ListItem item in listbox.Items)
  2. {
  3. item.Text = item.Text.ToUpper();
  4. }
Give this a try.

Nathan
Jun 21 '07 #2
Thanks for the reply. But how to add ListItem Class in my Win Application using C#.Net?

Thanking You,

softengg

You should be able to loop through the ListBox and change each item to uppercase using .ToUpper().

Expand|Select|Wrap|Line Numbers
  1. foreach(ListItem item in listbox.Items)
  2. {
  3. item.Text = item.Text.ToUpper();
  4. }
Give this a try.

Nathan
Jun 25 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by t8ntboy | last post: by
4 posts views Thread by Angela | last post: by
10 posts views Thread by LayneMitch via WebmasterKB.com | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.