SlideShare a Scribd company logo
• lets users type letters and enter data.
Property Name Description
BackColor Gets or sets the background color of the control.
Font Gets or sets the font of the text displayed by the control.
ForeColor Gets or sets the foreground color of the control.
MaxLength Gets or sets the maximum number of characters the user can type or
paste into the text box control.
Multiline Gets or sets a value indicating whether this is a multiline TextBox
control.
Name Gets or sets the name of the control.
PasswordChar Gets or sets the character used to mask characters of a password in a
single-line TextBox control.
Text Gets or sets the current text in the TextBox.
In this project
• Drag down a Textbox
• Drag down three buttons from common controls
• hello button (by clicking in this button it shows a messagebox (“hello”))
• exit button (by clicking in this button the application will be closed)
• Hi button (by clicking in this button it will show “hi” in the textbox
• Changing the backcolor , forecolor and font of button (from properties)
• Changing the backcolor , forecolor and font of Textbox(from properties)
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("hello");
}
private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = "hi";
}
Programming
Data Type
Int
String
Boolian
Double
Float
A data type specifies the size and type of variable values. It is important to use the correct
data type for the corresponding variable; to avoid errors, to save time and memory, but it
will also make your code more maintainable and readable. The most common data types are:
Data type in C#
int myInt = 10;
string myString = “hello”;
double myDouble = 5.25;
bool myBool = true;
It is also possible to convert data types explicitly by using built-in methods, such as
• Convert.ToBoolean,
• Convert.ToDouble,
• Convert.ToString,
• Convert.ToInt32 (int)
• Convert.ToInt64 (long)
• The most important characteristic
of a label control is the text it
displays.
• That text is also referred to as its
caption and this is what the user
would read.
• Important property is AutoSize.
In this project
• Drag down a three Textbox
• Drag down a three Labels
• Drag down four buttons from common controls
• + button (by clicking in this button textbox3 will show the result of A+B
• - button (by clicking in this button textbox3 will show the result of A-B
• / button (by clicking in this button textbox3 will show the result of A/B
• * button (by clicking in this button textbox3 will show the result of A*B
• Changing the backcolor , forecolor and font of button (from properties)
• Changing the backcolor , forecolor and font of Textbox(from properties)
• Changing the backcolor , forecolor and font of Labels(from properties)
int a, b, c;
private void button3_Click(object sender, EventArgs e)
{
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
c = a / b;
textBox3.Text = Convert.ToString(c);
}
private void button4_Click(object sender, EventArgs e)
{
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
c = a * b;
textBox3.Text = Convert.ToString(c);
}
private void button2_Click(object sender, EventArgs e)
{
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
c = a - b;
textBox3.Text = Convert.ToString(c);
}
private void button1_Click(object sender, EventArgs e)
{
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
c = a + b;
textBox3.Text = Convert.ToString(c);
}
Vp lecture 2 ararat

More Related Content

Similar to Vp lecture 2 ararat

Vs c# lecture1
Vs c# lecture1Vs c# lecture1
Vs c# lecture1
Saman M. Almufti
 
19c
19c19c
19csharp
19csharp19csharp
19csharp
Sireesh K
 
Vp lecture1 ararat
Vp lecture1 araratVp lecture1 ararat
Vp lecture1 ararat
Saman M. Almufti
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
prabhu rajendran
 
Unit2
Unit2Unit2
Html4
Html4Html4
Html Form Controls
Html Form ControlsHtml Form Controls
Tkinter_GUI_Programming_in_ Python.pdf
Tkinter_GUI_Programming_in_    Python.pdfTkinter_GUI_Programming_in_    Python.pdf
Tkinter_GUI_Programming_in_ Python.pdf
AnmolMogalai
 
Tkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_Python.pdfTkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_Python.pdf
ArielManzano3
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
Abhishek Kesharwani
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
Salim M
 
Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1
Bhushan Mulmule
 
Variables and calculations_chpt_4
Variables and calculations_chpt_4Variables and calculations_chpt_4
Variables and calculations_chpt_4
cmontanez
 
Python Graphical User Interface and design
Python Graphical User Interface and designPython Graphical User Interface and design
Python Graphical User Interface and design
VardhanKulkarni
 
Html Tutorial
Html TutorialHtml Tutorial
Html Tutorial
Md. Muhibbullah Muhib
 
Gitika html ppt
Gitika html pptGitika html ppt
Gitika html ppt
gitika -
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
Andi Simanjuntak
 
Delphi L02 Controls P1
Delphi L02 Controls P1Delphi L02 Controls P1
Delphi L02 Controls P1
Mohammad Shaker
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Nuzhat Memon
 

Similar to Vp lecture 2 ararat (20)

Vs c# lecture1
Vs c# lecture1Vs c# lecture1
Vs c# lecture1
 
19c
19c19c
19c
 
19csharp
19csharp19csharp
19csharp
 
Vp lecture1 ararat
Vp lecture1 araratVp lecture1 ararat
Vp lecture1 ararat
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 
Unit2
Unit2Unit2
Unit2
 
Html4
Html4Html4
Html4
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
Tkinter_GUI_Programming_in_ Python.pdf
Tkinter_GUI_Programming_in_    Python.pdfTkinter_GUI_Programming_in_    Python.pdf
Tkinter_GUI_Programming_in_ Python.pdf
 
Tkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_Python.pdfTkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_Python.pdf
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 
Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1
 
Variables and calculations_chpt_4
Variables and calculations_chpt_4Variables and calculations_chpt_4
Variables and calculations_chpt_4
 
Python Graphical User Interface and design
Python Graphical User Interface and designPython Graphical User Interface and design
Python Graphical User Interface and design
 
Html Tutorial
Html TutorialHtml Tutorial
Html Tutorial
 
Gitika html ppt
Gitika html pptGitika html ppt
Gitika html ppt
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
Delphi L02 Controls P1
Delphi L02 Controls P1Delphi L02 Controls P1
Delphi L02 Controls P1
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
 

More from Saman M. Almufti

Lecture 7- domain name
Lecture  7- domain nameLecture  7- domain name
Lecture 7- domain name
Saman M. Almufti
 
Vp lecture 11 ararat
Vp lecture 11 araratVp lecture 11 ararat
Vp lecture 11 ararat
Saman M. Almufti
 
Vp lecture 10 ararat
Vp lecture 10 araratVp lecture 10 ararat
Vp lecture 10 ararat
Saman M. Almufti
 
Vp lecture 12 ararat
Vp lecture 12 araratVp lecture 12 ararat
Vp lecture 12 ararat
Saman M. Almufti
 
Vp lecture 9 ararat
Vp lecture 9 araratVp lecture 9 ararat
Vp lecture 9 ararat
Saman M. Almufti
 
Lecture 6- http
Lecture  6- httpLecture  6- http
Lecture 6- http
Saman M. Almufti
 
Lecture 5- url-dns
Lecture  5- url-dnsLecture  5- url-dns
Lecture 5- url-dns
Saman M. Almufti
 
Vp lecture 7 ararat
Vp lecture 7 araratVp lecture 7 ararat
Vp lecture 7 ararat
Saman M. Almufti
 
Lecture 4- ip
Lecture  4- ipLecture  4- ip
Lecture 4- ip
Saman M. Almufti
 
Vp lecture 6 ararat
Vp lecture 6 araratVp lecture 6 ararat
Vp lecture 6 ararat
Saman M. Almufti
 
Vp lecture 5 ararat
Vp lecture 5 araratVp lecture 5 ararat
Vp lecture 5 ararat
Saman M. Almufti
 
Lecture 3- tcp-ip
Lecture  3- tcp-ipLecture  3- tcp-ip
Lecture 3- tcp-ip
Saman M. Almufti
 
Vp lecture 4 ararat
Vp lecture 4 araratVp lecture 4 ararat
Vp lecture 4 ararat
Saman M. Almufti
 
Vp lecture 3 ararat
Vp lecture 3 araratVp lecture 3 ararat
Vp lecture 3 ararat
Saman M. Almufti
 
Lecture 2- terminology
Lecture  2- terminologyLecture  2- terminology
Lecture 2- terminology
Saman M. Almufti
 
Lecture 1- introduction
Lecture  1- introductionLecture  1- introduction
Lecture 1- introduction
Saman M. Almufti
 
Vs c# lecture12
Vs c# lecture12Vs c# lecture12
Vs c# lecture12
Saman M. Almufti
 
Vs c# lecture11
Vs c# lecture11Vs c# lecture11
Vs c# lecture11
Saman M. Almufti
 
Vs c# lecture10
Vs c# lecture10Vs c# lecture10
Vs c# lecture10
Saman M. Almufti
 
Vs c# lecture9
Vs c# lecture9Vs c# lecture9
Vs c# lecture9
Saman M. Almufti
 

More from Saman M. Almufti (20)

Lecture 7- domain name
Lecture  7- domain nameLecture  7- domain name
Lecture 7- domain name
 
Vp lecture 11 ararat
Vp lecture 11 araratVp lecture 11 ararat
Vp lecture 11 ararat
 
Vp lecture 10 ararat
Vp lecture 10 araratVp lecture 10 ararat
Vp lecture 10 ararat
 
Vp lecture 12 ararat
Vp lecture 12 araratVp lecture 12 ararat
Vp lecture 12 ararat
 
Vp lecture 9 ararat
Vp lecture 9 araratVp lecture 9 ararat
Vp lecture 9 ararat
 
Lecture 6- http
Lecture  6- httpLecture  6- http
Lecture 6- http
 
Lecture 5- url-dns
Lecture  5- url-dnsLecture  5- url-dns
Lecture 5- url-dns
 
Vp lecture 7 ararat
Vp lecture 7 araratVp lecture 7 ararat
Vp lecture 7 ararat
 
Lecture 4- ip
Lecture  4- ipLecture  4- ip
Lecture 4- ip
 
Vp lecture 6 ararat
Vp lecture 6 araratVp lecture 6 ararat
Vp lecture 6 ararat
 
Vp lecture 5 ararat
Vp lecture 5 araratVp lecture 5 ararat
Vp lecture 5 ararat
 
Lecture 3- tcp-ip
Lecture  3- tcp-ipLecture  3- tcp-ip
Lecture 3- tcp-ip
 
Vp lecture 4 ararat
Vp lecture 4 araratVp lecture 4 ararat
Vp lecture 4 ararat
 
Vp lecture 3 ararat
Vp lecture 3 araratVp lecture 3 ararat
Vp lecture 3 ararat
 
Lecture 2- terminology
Lecture  2- terminologyLecture  2- terminology
Lecture 2- terminology
 
Lecture 1- introduction
Lecture  1- introductionLecture  1- introduction
Lecture 1- introduction
 
Vs c# lecture12
Vs c# lecture12Vs c# lecture12
Vs c# lecture12
 
Vs c# lecture11
Vs c# lecture11Vs c# lecture11
Vs c# lecture11
 
Vs c# lecture10
Vs c# lecture10Vs c# lecture10
Vs c# lecture10
 
Vs c# lecture9
Vs c# lecture9Vs c# lecture9
Vs c# lecture9
 

Recently uploaded

AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 

Recently uploaded (20)

AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 

Vp lecture 2 ararat

  • 1.
  • 2. • lets users type letters and enter data. Property Name Description BackColor Gets or sets the background color of the control. Font Gets or sets the font of the text displayed by the control. ForeColor Gets or sets the foreground color of the control. MaxLength Gets or sets the maximum number of characters the user can type or paste into the text box control. Multiline Gets or sets a value indicating whether this is a multiline TextBox control. Name Gets or sets the name of the control. PasswordChar Gets or sets the character used to mask characters of a password in a single-line TextBox control. Text Gets or sets the current text in the TextBox.
  • 3. In this project • Drag down a Textbox • Drag down three buttons from common controls • hello button (by clicking in this button it shows a messagebox (“hello”)) • exit button (by clicking in this button the application will be closed) • Hi button (by clicking in this button it will show “hi” in the textbox • Changing the backcolor , forecolor and font of button (from properties) • Changing the backcolor , forecolor and font of Textbox(from properties)
  • 4. private void button1_Click(object sender, EventArgs e) { MessageBox.Show("hello"); } private void button2_Click(object sender, EventArgs e) { Application.Exit(); } private void button3_Click(object sender, EventArgs e) { textBox1.Text = "hi"; }
  • 6. A data type specifies the size and type of variable values. It is important to use the correct data type for the corresponding variable; to avoid errors, to save time and memory, but it will also make your code more maintainable and readable. The most common data types are:
  • 7. Data type in C# int myInt = 10; string myString = “hello”; double myDouble = 5.25; bool myBool = true;
  • 8. It is also possible to convert data types explicitly by using built-in methods, such as • Convert.ToBoolean, • Convert.ToDouble, • Convert.ToString, • Convert.ToInt32 (int) • Convert.ToInt64 (long)
  • 9. • The most important characteristic of a label control is the text it displays. • That text is also referred to as its caption and this is what the user would read. • Important property is AutoSize.
  • 10. In this project • Drag down a three Textbox • Drag down a three Labels • Drag down four buttons from common controls • + button (by clicking in this button textbox3 will show the result of A+B • - button (by clicking in this button textbox3 will show the result of A-B • / button (by clicking in this button textbox3 will show the result of A/B • * button (by clicking in this button textbox3 will show the result of A*B • Changing the backcolor , forecolor and font of button (from properties) • Changing the backcolor , forecolor and font of Textbox(from properties) • Changing the backcolor , forecolor and font of Labels(from properties)
  • 11. int a, b, c; private void button3_Click(object sender, EventArgs e) { a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); c = a / b; textBox3.Text = Convert.ToString(c); } private void button4_Click(object sender, EventArgs e) { a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); c = a * b; textBox3.Text = Convert.ToString(c); }
  • 12. private void button2_Click(object sender, EventArgs e) { a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); c = a - b; textBox3.Text = Convert.ToString(c); } private void button1_Click(object sender, EventArgs e) { a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); c = a + b; textBox3.Text = Convert.ToString(c); }