SlideShare a Scribd company logo
1 of 13
• 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

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
 

Similar to Vp lecture 2 ararat (20)

Vs c# lecture1
Vs c# lecture1Vs c# lecture1
Vs c# lecture1
 
19csharp
19csharp19csharp
19csharp
 
19c
19c19c
19c
 
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
 
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
 
wt mod2.pdf
wt mod2.pdfwt mod2.pdf
wt mod2.pdf
 

More from 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

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

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); }