Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 8th, 2003, 09:42 AM
Authorized User
Join Date: Jun 2003
Location: Rio de Janeiro, Rio de Janeiro, Brazil.
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Capital Letters in a COMBOBOX. How can i do it?

How I can place in capital letters the text of a COMBOBOX?
For TEXTBOX I use:
textBox1.CharacterCasing = CharacterCasing.Upper;...
How to make the same for a COMBOBOX?
There isnt a CharacterCasing metod for a COMBOBOX...
Reply With Quote
  #2 (permalink)  
Old September 8th, 2003, 10:26 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

Hi Thomaz,

If it's not supported, you should do it by hand. When you add items to the drop-down, change the text to upper case right before you add the item. To allow users to add their own items, write some code for when the drop-down looses focus (in the LostFocus event) and change the case for the item that has been inserted.

There may be other ways as well, but this is what I would try first.



Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old October 17th, 2003, 11:47 PM
Registered User
Join Date: Oct 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts


Here is how I did it. In the TextChanged event of the ComboBox add the following code:

ComboBox thisBox = ( ComboBox )sender;
int cursorPosition = thisBox.SelectionStart;
thisBox.Text = thisBox.Text.ToUpper();
thisBox.SelectionStart = cursorPosition;

I hope this helps.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Latin letters itHighway Classic ASP Professional 3 July 20th, 2006 12:14 AM
"C++ lottery" with letters and words dovids C++ Programming 8 July 19th, 2005 03:11 AM
Help with letters ittorget Classic ASP Basics 3 October 14th, 2003 01:11 PM
Capital Letters no Vowels. endamist BOOK: Beginning Java 2 1 August 12th, 2003 05:59 PM

All times are GMT -4. The time now is 11:44 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.