Change Case: Uppercase and Lowercase in C#
Submitted by donbermoy on Saturday, July 12, 2014 - 23:08.
Today in C#, I will teach you how to create a program that changes case either uppercase or lowercase letters using C#.
Now, let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio 2010: Go to File, click New Project, and choose Windows Application.
2. Next, add two Buttons named Button1 and labeled it as "Uppercase" and Button2 labeled as "Lowercase". Insert two textbox named Textbox1 for inputting a desired string and Textbox2 for displaying the output. You must design your interface like this:
3. For button1, put this code below.
ToUpper() function in vb.net converts the text to uppercase letters. This is why the button1 means an uppercase button to display the capital letters in textbox2.
Output:
4. For button2, put this code below.
The opposite of the ToUpper() is the ToLower(). ToLower() function means convert the string into Lowercase letters. This will display small letters in textbox2.
Output:
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
If you have some queries, feel free to contact the number or e-mail below.
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware
- public void Button1_Click(System.Object sender, System.EventArgs e)
- {
- TextBox2.Text = TextBox1.Text.ToUpper();
- }
- public void Button2_Click(System.Object sender, System.EventArgs e)
- {
- TextBox2.Text = TextBox1.Text.ToLower();
- }
Add new comment
- 138 views