Tuesday 28 May 2013

C# chapter 3 : C# or C sharp For Beginer, More Detail

C# chapter 3 :


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

OK!  Let continue !

Switch  between    program Code view   &  Forms View
use mouse click to Switch between   program Code view   &  Forms View
click on  Form1.cs  or  click on  Form1.cs [Design]


click on  Form1.cs
 click on  Form1.cs [Design]

TextBox

Learn to Lock the textbox , so no one can edit any things that inside the box.
Learn to Copy the content of the  textbox , part of  or Fully. 
Learn to unable Copy the content of the  textbox , part of  or Fully.


Lock the textbox , so no one can edit any things that inside the box.
click on  Form1.cs [Design] 
click on  textBox1
Use Mouse drag the scroll bar on the  Properties  on the bottom right   to find    Behavior ,  then click on the  ReadOnly   a few line below Behavior ,  use the mouse to change the  False  to  True.   The Textbox will become grey color.


 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.
Now you can not type in or delete anythings  inside the text box.
Click X to close the Form.
Now change it back !  Change ReadOnly   a few line below Behavior ,  from True to False , to be able the edit function.


Copy the content of the  textbox , part of  or Fully. 
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.
Use mouse click and drag inside the textbox , then Right click . Now you choose : copy ,  cut , paste , etc...




now you know how to copy


Unable Copy the content of the  textbox , part of  or Fully.  LOCK & CAN NOT COPY
To lock the content , so no one can edit or copy any things that inside the box.
click on  Form1.cs [Design] 
click on  textBox1
Use Mouse drag the scroll bar on the  Properties  on the bottom right   to find    Behavior ,  then click on the  Enabled   a few line below Behavior ,  use the mouse to change the   True to  False.


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.
Now you can not type in or delete anythings  inside the text box. Also you cannot right click inside the textbox. All inside this textbox is LOCK.
Click X to close the Form.
Now change it back !  Change    Enabled     a few line below Behavior ,  from   False  to  True , to be able the edit function.

 That all for now for the textbox. If you find out any special function of textbox , please let me know.
I still a beginner here.  Thank at first ~ ~ ~ .




___________________________________________
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




AcuAids AstroNutrition Global Gear Pocket Strategist Anytimeherbal - Herbal Remedies, Supplements, Herbs Capsules and Vitamins. Calorad Century Supplements Thorn Equipment Finance Amino Z - Natural Weight Loss And Supplements Apex Sales - Leaders in health, hygiene and packaging supplies Associate-O-Matic

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



C# chapter 1 : C# or C sharp For Beginer

c# Chapter 1


Let   WIRTE    our   FIRST c#  program !


It have been about 2 month, I not write on this blog !
I am learning about Microsoft Visual C# (They call it C Sharp) all these times.

Now I can write some simple program.  OK! Let start.

1st]  MUST have Microsoft Visual C#.

2nd] Install it.

3rd] Start the program.

4th] Select : File -> New -> Project


5th] select .Net Framework 2.0 , then select Windows Forms Application, type your File Name, File Path.
        Then select OK.


6th]  After a while, the form come out . Find the ToolBox Tab, that is on the Left side of the sreen. Click it.    Then  Click the Pin on the Toolbox  to Lock it.  [Must do this.]



7th]   Use mouse click and Drag to resize the form


8th]  Use Mouse drag the scroll bar on the ToolBox to find    TextBox  , click on it , then click near on the left side in the form. Drag to the right side.  Release the mouse , Then   press keyboard   Esc .



9th]  Use Mouse drag the scroll bar on the  Properties  on the bottom right   to find    Multiline  ,  use the mouse to the change False  to  True.   The Textbox will become bigger.



10th]  Use Mouse drag the scroll bar on the ToolBox to find    Button  , click on it , then click in the form. Drag to the right side.  Release the mouse , Then   press keyboard   Esc .   Remember to  press keyboard   Esc      every time !

   Now there is a  Button in the form. Program is  write  inside the button.

OK!  Let start our FIRST c#  program !
I call it  Hello World !
It will show up  inside the Textbox  in the Form.


1}  Double click on button1
~  ~ Wait for a while  ~ ~ ~
This screen will come out.



2}   OK!  Let   WIRTE    our FIRST c#  program !  

This is the blank button1 program , DON'T DELETE ANY OF THESE !

        private void button1_Click(object sender, EventArgs e)
        {
        }


INSIDE THE   {   }   WIRTE  YOUR  PROGRAM (you can copy and paste these 3 Lines below)
            string STR_A;
            STR_A = " Hello World";
            textBox1.Text = STR_A;


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

** MUST MATCH CASE **   A IS A , a is a  ,  a Is Not A  ,  A is Not a


3}  Select  Debug -> Start without Debugging
~  ~ Wait for a while  ~ ~ ~




  ~  ~ Wait for a while  ~ ~ ~
This screen will come out.



4}   Let  click on button1
     Hello World  
  will show up  inside the Textbox.


Try type some words inside the TextBox , then click on button1
     Hello World  
  will show up  inside the Textbox.   The words you type is gone!
Ha! Ha!  This is all because of   button1  that you click.

 Click  the  X   to close it.

So,  our  FIRST c# program work.  Next chapter I will show how to improve this program.


___________________________________________
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



AcuAids AstroNutrition Global Gear Pocket Strategist Anytimeherbal - Herbal Remedies, Supplements, Herbs Capsules and Vitamins. Calorad Century Supplements Thorn Equipment Finance Amino Z - Natural Weight Loss And Supplements Apex Sales - Leaders in health, hygiene and packaging supplies
Associate-O-Matic