Vp lecture 2 ararat
• 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

PPT
The msg box function and the messagebox class
PPTX
Dialog box in vb6
PPT
INPUT BOX- VBA
PPT
5. combobox
PDF
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
DOCX
Mi 103 mi 103 quiz 2 (1)
PDF
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
PDF
tutorial21
The msg box function and the messagebox class
Dialog box in vb6
INPUT BOX- VBA
5. combobox
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Mi 103 mi 103 quiz 2 (1)
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
tutorial21

Similar to Vp lecture 2 ararat (20)

PPTX
Vs c# lecture1
PPTX
19csharp
PPTX
PPTX
Vp lecture1 ararat
PPTX
Windowforms controls c#
PPSX
PDF
Unit 5-Introduction of GUI Programming-Part2.pdf
PDF
Tkinter_GUI_Programming_in_Python.pdf
PDF
Tkinter_GUI_Programming_in_ Python.pdf
PPTX
uptu web technology unit 2 html
PPTX
Basic controls of Visual Basic 6.0
PDF
Windows Forms For Beginners Part - 1
PPTX
Variables and calculations_chpt_4
PPTX
Python Graphical User Interface and design
PPTX
Tkinter_GUI_Programming_in_Pythovvn.pptx
PPTX
Tkinter_GUI_Programming_in_Pythovvn.pptx
PPTX
Html Tutorial
PPTX
ch 3 of C# programming in advanced programming
Vs c# lecture1
19csharp
Vp lecture1 ararat
Windowforms controls c#
Unit 5-Introduction of GUI Programming-Part2.pdf
Tkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_ Python.pdf
uptu web technology unit 2 html
Basic controls of Visual Basic 6.0
Windows Forms For Beginners Part - 1
Variables and calculations_chpt_4
Python Graphical User Interface and design
Tkinter_GUI_Programming_in_Pythovvn.pptx
Tkinter_GUI_Programming_in_Pythovvn.pptx
Html Tutorial
ch 3 of C# programming in advanced programming
Ad

More from Saman M. Almufti (20)

PPTX
Lecture 7- domain name
PPTX
Vp lecture 11 ararat
PPTX
Vp lecture 10 ararat
PPTX
Vp lecture 12 ararat
PPTX
Vp lecture 9 ararat
PPTX
Lecture 6- http
PPTX
Lecture 5- url-dns
PPTX
Vp lecture 7 ararat
PPTX
Lecture 4- ip
PPTX
Vp lecture 6 ararat
PPTX
Vp lecture 5 ararat
PPTX
Lecture 3- tcp-ip
PPTX
Vp lecture 4 ararat
PPTX
Vp lecture 3 ararat
PPTX
Lecture 2- terminology
PPTX
Lecture 1- introduction
PPTX
Vs c# lecture12
PPTX
Vs c# lecture11
PPTX
Vs c# lecture10
PPTX
Vs c# lecture9
Lecture 7- domain name
Vp lecture 11 ararat
Vp lecture 10 ararat
Vp lecture 12 ararat
Vp lecture 9 ararat
Lecture 6- http
Lecture 5- url-dns
Vp lecture 7 ararat
Lecture 4- ip
Vp lecture 6 ararat
Vp lecture 5 ararat
Lecture 3- tcp-ip
Vp lecture 4 ararat
Vp lecture 3 ararat
Lecture 2- terminology
Lecture 1- introduction
Vs c# lecture12
Vs c# lecture11
Vs c# lecture10
Vs c# lecture9
Ad

Recently uploaded (20)

PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPT
Geologic Time for studying geology for geologist
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Hybrid model detection and classification of lung cancer
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPTX
The various Industrial Revolutions .pptx
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Getting Started with Data Integration: FME Form 101
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
August Patch Tuesday
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Zenith AI: Advanced Artificial Intelligence
Geologic Time for studying geology for geologist
Taming the Chaos: How to Turn Unstructured Data into Decisions
Hybrid model detection and classification of lung cancer
Group 1 Presentation -Planning and Decision Making .pptx
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
The various Industrial Revolutions .pptx
A review of recent deep learning applications in wood surface defect identifi...
Getting Started with Data Integration: FME Form 101
Univ-Connecticut-ChatGPT-Presentaion.pdf
sustainability-14-14877-v2.pddhzftheheeeee
Benefits of Physical activity for teenagers.pptx
Assigned Numbers - 2025 - Bluetooth® Document
DP Operators-handbook-extract for the Mautical Institute
Enhancing emotion recognition model for a student engagement use case through...
August Patch Tuesday
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Tartificialntelligence_presentation.pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...

Vp lecture 2 ararat

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