1 C# Programming Myanmar
C# Programming
C#
Microsoft Visual studio 2013 install ႔
Misrosoft Sql install
CUP ႔ memory
install ႔
Visual studio
၁ Console application
၂ Windows application
၃ Web application
Windows application
Programming language ႔
-Web Developer
-Windows Software Developer
-Game Developer
-Mobile App Developer
Windows Software Developer
programming fundamental language
programming
programming fundamental
႔ ႔
2 C# Programming Myanmar
C# programming
C# programming
Microsoft company ႔ language Visual studio
application error
application c#
programming
System.out.print ႔ run ႔
႔ Windows form ႔
႔
Application ႔---
Application ႔
-programming
- ( )
-Database ( Select )
-Database ႔
Windows application
---
Software developer
႔
႔ ႕
႔ ႔
႔ ႔ ႔
႔
3 C# Programming Myanmar
႕ c# programming ႔
C# Programming
႕ ႔
၅
႔
European Computer Manufacturers Association ႔
႕
- ႔
႔
႔ ႔
႔
- Boolean Conditions
- Automatic Garbage Collection
- Standard Library
- Assembly Versioning
- Propertties and Events
- Delegates and Events Management
- Easy to use Generics
- Indexers
- Conditions Compliation
- Simple Multithreading
- LINQ and Lambda Expressions
- ႔ Lan
4 C# Programming Myanmar
႔
႔ ႔ ႔
႔ ႔
႔
႔
႔ ႔
႔
႔
႔
- Common Language Runtime (CLR)
- The .Net Framework Class Library
- Common Language Specification
- Common Type System
- Metadata and Assemblies
- Windows Forms
- ASP.Net and ASP.Net AJAX
- ADO.Net
- Windows Workflow Foundation (WF)
- Windows Presentation Foundation
- Windows Communication Foundation (WCF)
-
႔
႔
႔
5 C# Programming Myanmar
Xamarin Frame ႔
႔ ႔ ႔ Xamarin
႕ ႔
- Native UI, Native API, Native Performance
- Objecti - ႔
႔ ႔
႕
Junior ႔
႔
6 C# Programming Myanmar
Microsoft visual studio 2013
project ႔ new project
language
Visual C# ႔ ႔
7 C# Programming Myanmar
Visual studio
visual c# ႔
႔ menu Windows Windows
Forms Application
Name frmTest ႔
Location project ႔ folder
႔
Project
8 C# Programming Myanmar
C# (၂
႔ ႔
-
(၁) Projects
႔
Projects ႔ Windows form
႔ properties ႔
Solution explorer ႔
Toolbox Form
9 C# Programming Myanmar
Toolbox ႕
Button
10 C# Programming Myanmar
႕ button1 button
button1 Save
Properties Text button1 ႔
Save ႔
Properties And Event
Property Event
Property
Event ႔
႔
frmTest Windows Form
Save ႔ button1
frmTest Programming ႔ class
button1 class
programming Class Method ႔ Event ႔
11 C# Programming Myanmar
Windows Form Property ႔ Event
Save Button1 Property ႔ Event
properties
ABC ႔
Design Name button1 btnSave ႔
button ႕ Properties
12 C# Programming Myanmar
Event
mouse Event ႔
button ႕ Event
event save button button
႕ properties
---
13 C# Programming Myanmar
Save message box
Save double click
button ႔
run ---
Run ႔
14 C# Programming Myanmar
႔
hello world ႔
Textbox ႔ label
================
Save
Textbox
Label (label )
================
႔
15 C# Programming Myanmar
label ႔ textbox ႕
16 C# Programming Myanmar
႔
Save button
Save button
label1.Text = textBox1.Text;
Run textbox save button
Programming
႔ chat box java
႔
Data types and Variables
programming language ႔
႔ ႔ ႔
Variable ႔ Data computer memory (RAM)
Data ႔
data type
၁ Declaration (data type )
၂ Definition ( ႕ )//
၃ assign (data )
variable
17 C# Programming Myanmar
program
18 C# Programming Myanmar
Int number integer data type = assignment operator textbox
number textbox String
int.Parse(); method
textbox number
number ႕ int ႔ Error
MessageBox.Show(number.Tostring());
number MessageBox ႔ ႔ Show() method
Messagebox (string) number
Tostring() method ႔
calculator textbox label
Button
Label
Textbox
Properties
19 C# Programming Myanmar
textbox
from ႕ Text calculator ႔
code
calculator ႔
၁ textbox ၂
၂ textbox ၂
၃
၄ amount ႔ textbox ၄ ႔
20 C# Programming Myanmar
textbox ႔ textbox ၂
+ double click
int number1 = int.Parse(txtfirstnumber.Text);
int number2 = int.Parse(txtsecondnumber.Text);
int amount = number1 + number2;
txtamount.Text = amount.ToString();
Run
int number1 ႔ txtfirstnumber textbox
int.Parse();
int number2 ႔ txtsecondnumber textbox
int amount = number1 + number2;
amount int integer type number1 + number2
= assignment operator
amount
txtamount amount textbox
Textbox amount
txtamount.Text=amount.ToString();
ToString() method
21 C# Programming Myanmar
command
/**
int number1 = int.Parse(txtfirstnumber.Text);
int number2 = int.Parse(txtsecondnumber.Text);
int amount = number1 + number2;
txtamount.Text = amount.ToString();
* */
txtamount.Text= txtfirstnumber .Text + txtsecondnumber.Text;
Textbox ႔
22 C# Programming Myanmar
if statement
If statement ႔
Operator Description Example
== ႔ ႔ true A==B
A ႔B
?
!= ႔ ႔ true A!=B
A ႔B
?
> 1>2
႔ ၁ ၂
?
< 1<2
႔ ၁ ၂
?
>= 1>=2
႔ ၁ ၂
႔ ?
( ) ႔
<= 1>=2
႔ ၁ ၂
႔ ?
( ) ႔
=
Programming = assign
23 C# Programming Myanmar
If( )
{
}
Else
{
if ႔ () {}
If ႔ {}
Else ႔ if else
Calculator
Windows form frmcalculator ႔
Textbox
Button 3
24 C# Programming Myanmar
၁ textbox
၂
၃ textbox variable
textbox ႔ )
၅ textbox variable
႔ textbox textbox
-
၁ (click event)
၂ variable (int number= int.Parse(txtresult.Text))
၃ textbox (txtresult.Clear())
၄ (number+int.Parse(txtresult.Text))
႔
Plus ႔ Minus user
႔ variable
string myoperator; ႔
btnplus ႕ click event ႔
btnminus
25 C# Programming Myanmar
== ႔ =
if (myoperator == "+")
{
txtresult.Text = Convert.ToString(number +
int.Parse(txtresult.Text));
}
else if (myoperator == "-")
{
txtresult.Text = Convert.ToString(number -
int.Parse(txtresult.Text));
}
+ button myoperator + ႔
if ႔
myoperator + ႔ number ႔ textbox textbox
႔ + - if
myoperator - ႔ else if
26 C# Programming Myanmar
႔ relational operator
calculator ႕
႔ select Font properties
27 C# Programming Myanmar
btnZero ႕ btn ႔ ႔
Textbox txtResult ႔
namespace Calculator
{
public partial class FrmCalculator : Form
{
public FrmCalculator()
{
InitializeComponent();
}
private void btnZero_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "0";
}
else
{
txtResult.Text += "0";
}
}
private void btnDzero_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0" || txtResult.Text=="00")
{
txtResult.Text = "0";
}
else
{
txtResult.Text += "00";
}
}
private void btnDot_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
28 C# Programming Myanmar
{
txtResult.Text = "0";
}
else
{
txtResult.Text += ".";
}
}
private void btnOne_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "1";
}
else
{
txtResult.Text += "1";
}
}
private void btnTwo_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "2";
}
else
{
txtResult.Text += "2";
}
}
private void btnThree_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "3";
}
else
29 C# Programming Myanmar
{
txtResult.Text += "3";
}
}
private void btnFour_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "4";
}
else
{
txtResult.Text += "4";
}
}
private void btnFive_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "5";
}
else
{
txtResult.Text += "5";
}
private void btnSix_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "6";
}
else
{
txtResult.Text += "6";
}
30 C# Programming Myanmar
private void btnSeven_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "7";
}
else
{
txtResult.Text += "7";
}
}
private void btnEight_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "8";
}
else
{
txtResult.Text += "8";
}
}
private void btnNine_Click(object sender, EventArgs e)
{
if (txtResult.Text == "0")
{
txtResult.Text = "9";
}
else
{
txtResult.Text += "9";
}
}
private void btnClear_Click(object sender, EventArgs e)
{
31 C# Programming Myanmar
txtResult.Text = "0";
}
private void btnBack_Click(object sender, EventArgs e)
{
txtResult.Text = txtResult.Text.Remove(txtResult.Text.Length - 1, 1);
}
}
}
႔ clear backspace zero
string operation;
double num1;
private void btnEqul_Click(object sender, EventArgs e)
{
if (num1 != null && operation=="+")
{
txtResult.Text = Convert.ToString(num1 + double.Parse(txtResult.Text));
}
else if (num1 != null && operation == "-")
{
txtResult.Text = Convert.ToString(num1 - double.Parse(txtResult.Text));
}
else if (num1 != null && operation == "*")
{
txtResult.Text = Convert.ToString(num1 * double.Parse(txtResult.Text));
}
else if (num1 != null && operation == "/")
{
txtResult.Text = Convert.ToString(num1 / double.Parse(txtResult.Text));
}
else if (num1 != null && operation == "%")
{
txtResult.Text = Convert.ToString(num1 % double.Parse(txtResult.Text));
}
}
32 C# Programming Myanmar
private void btnPlus_Click(object sender, EventArgs e)
{
num1 = double.Parse(txtResult.Text);
txtResult.Clear();
operation = "+";
}
private void btnMinus_Click(object sender, EventArgs e)
{
num1 = double.Parse(txtResult.Text);
txtResult.Clear();
operation = "-";
}
private void btnMultiple_Click(object sender, EventArgs e)
{
num1 = double.Parse(txtResult.Text);
txtResult.Clear();
operation = "*";
}
private void btnDiv_Click(object sender, EventArgs e)
{
num1 = double.Parse(txtResult.Text);
txtResult.Clear();
operation = "/";
}
private void btnModule_Click(object sender, EventArgs e)
{
num1 = double.Parse(txtResult.Text);
txtResult.Clear();
operation = "%";
}
string operation; double num1; + + ႔ +-/*
string operation
႔ ႔+ ႔ ႔ num1
႔ num1