XTab's Blog

Ged Mead's Blog at vbCity

vbCity Blogs moved to:
http://cs.vbcity.com/blogs
  Home :: Syndication  :: Login

JulAugust 2006Sep
SMTWTFS
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

Archives

Topics

Ramblings

VB.NET

Monday, August 07, 2006 #

  Here's another in the "Almost too obvious to mention" category, although not new to VB2005.

  One of the new things we learned when the first version of VB.NET came along was that we could use the ToUpper and ToLower methods to convert a string into all upper or all lower case characters.   Don't know about you, but ever since 2002 if I wanted to take user input in a TextBox and then convert it to lower case I've always done something like:

 Dim s as String = TextBox1.Text.ToLower

or even cutting out the middleman and going with just:

 Console.WriteLine(TextBox1.Text.ToLower)

  Both these approaches work just fine, but I was grubbing through the built in properties of the TextBox control today and happened upon the CharacterCasing property which I'd never noticed before.  A click on the little down arrow in the Property Seting cell and, hey presto, you have an instant choice of either Upper or Lower case.  Select your preference and any text entered by users in that particular TextBox will be automatically converted in front of their very eyes into upper or lower casing.

      I wonder how many more of these useful little features are still lying around unnoticed and waiting to be discovered on a slow day?     More than I'll trip over in my lifetime, I'm thinking.

 

 

 

posted @ 3:00 AM