Change Case: Uppercase and Lowercase in C#

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: design 3. For button1, put this code below.
  1. public void Button1_Click(System.Object sender, System.EventArgs e)
  2. {
  3. TextBox2.Text = TextBox1.Text.ToUpper();
  4. }
ToUpper() function in converts the text to uppercase letters. This is why the button1 means an uppercase button to display the capital letters in textbox2. Output: output 4. For button2, put this code below.
  1. public void Button2_Click(System.Object sender, System.EventArgs e)
  2. {
  3. TextBox2.Text = TextBox1.Text.ToLower();
  4. }
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: 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: Visit and like my page on Facebook at:

Add new comment