Tuesday, 28 May 2013

C# chapter 2 : C# or C sharp For Beginer, more detail

C# chapter 2 :

For any one that have not read chapter 1 , Please refer C# chapter 1  if have any question.

OK!  Let continue !

Multi Line
 "\r\n"       denotes a carriage return and a linefeed
  +           Is for adding two Line together.


change 1 : Multi Line

FROM THIS
        private void button1_Click(object sender, EventArgs e)
        {
            string STR_A;
            STR_A = " Hello World";
            textBox1.Text = STR_A;
        }

CHANGE TO
        private void button1_Click(object sender, EventArgs e)
        {
            string STR_A;
            STR_A = " Hello World" + "\r\n" + " Hello World";
            textBox1.Text = STR_A;
        }

THEN  Select  Debug -> Start without Debugging
~  ~ Wait for a while  ~ ~ ~
The program Form screen will come out.
Let  click on button1
     Hello World
     Hello World
will show up  inside the Textbox.




 change 2 : Multi Line

change 2 is just like change 1 , only the code is change
FROM THIS
        private void button1_Click(object sender, EventArgs e)
        {
            string STR_A;
            STR_A = " Hello World";
            textBox1.Text = STR_A;
        }

CHANGE TO
        private void button1_Click(object sender, EventArgs e)
        {
            string STR_A;
            STR_A = " Hello World";
            textBox1.Text = STR_A + "\r\n" + STR_A;
        }

 THEN  Select  Debug -> Start without Debugging
~  ~ Wait for a while  ~ ~ ~
The program Form screen will come out.
Let  click on button1
     Hello World
     Hello World
will show up  inside the Textbox.

 change 3 : Multi Line

change 3 is just like change 1 & 2 , only the code is change
FROM THIS
        private void button1_Click(object sender, EventArgs e)
        {
            string STR_A;
            STR_A = " Hello World";
            textBox1.Text = STR_A;
        }

CHANGE TO
        private void button1_Click(object sender, EventArgs e)
        {
            string STR_A, STR_B;
            STR_A = " Hello World";
            STR_B = "\r\n";
            textBox1.Text = STR_A + STR_B + STR_A;
        }

 THEN  Select  Debug -> Start without Debugging
~  ~ Wait for a while  ~ ~ ~
The program Form screen will come out.
Let  click on button1
     Hello World
     Hello World
will show up  inside the Textbox.


From these 3 change , you can saw that there are many way to Write the code , but the is output result is just the same !   It just depend on which way you like to Write the code. Which way work best for you.



___________________________________________
Need More Detail ?   contact me !!
Please send me some money at  Paypal
Any small amount is welcome , even 10 cents is good for me.

I will guide you step by step, personally.
My Paypal Account is :   ksw.industries@gmail.com


Don't know how to send money ?   Click here for detail about Paypal account.
http://xyberpast.blogspot.com/2014/05/how-to-get-my-program.html

Don't have money? OK! Here is another way to get the program.
how to get my program - Free of charge



No comments:

Post a Comment