Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Question No 1 Write down the summary of Topic 1.3 and 1.4 of your Text Book in your own words.

Summary:

C# is object oriented. C# has access to the powerful .NET Framework Class Library—a vast
collection of prebuilt classes that enable you to develop apps quickly. C# graphical user interfaces
(GUIs) are event driven. You can write programs that respond to user-initiated events such as
mouse clicks, keystrokes.

In 2000, Microsoft announced its .NET initiative (www.microsoft.com/net), a broad vision for using
the Internet and the web in the development, engineering, distribution and use of software. The
.NET Framework Class Library provides many capabilities that you’ll use to build substantial C#
apps quickly and easily. The Common Language Runtime (CLR), another key part of the .NET
Framework, executes .NET programs and provides functionality to make them easier to develop
and debug.

Question No.2 Write down the definition, 5 properties, 2 events of Listbox and PictureBox Control.

5 properties :
Checked
Gets or sets a value indicating whether the check box is selected.
Font
This property specify font type, style, size
Height
This is the height of the Form in pixels.
MinimizeBox
By default, this property is True and you can set it to False to hide the Minimize button on the title
bar.
MaximizeBox
By default, this property is True and you can set it to False to hide the Maximize button on the title
bar.
MinimumSize
This specifies the minimum height and width of the window you can minimize.

NumericUpDown Control :
A NumericUpDown control allows users to provide a spin (up/down) interface to move through
pre-defined numbers using up and down arrows.
Question No 3: Identify control in the given form Write down how many controls are on the form and
what are their control name and user defined name.

Mention all controls and their specified properties. Also write down the code of Form and Button.

Answer :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Departmenttt
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)


{
dep.Items.Add("computer science");
dep.Items.Add("Information Technology");
dep.Items.Add("English");
dep.Items.Add("Math");

private void dep _SelectedIndexChanged(object sender, EventArgs e)


{
if (dep.SelectedIndex == 0)
{
l2.Items.Clear();
l2.Items.Add("Bscs");
l2.Items.Add("Bcs");
l2.Items.Add("Mcs");
l2.Items.Add("MScs");

}
else if (dep.SelectedIndex == 1)
{
l2.Items.Clear();
l2.Items.Add("BsIT");
l2.Items.Add("MIT");
l2.Items.Add("MSIT");

}
else if (dep.SelectedIndex == 2)
{
l2.Items.Clear();
l2.Items.Add("BsEnglish");
l2.Items.Add("MSEnglish");
}
else if (dep.SelectedIndex == 3)
{
l2.Items.Clear();
l2.Items.Add("BsMath");
l2.Items.Add("MSMath");
}
else
{
MessageBox.Show("select the list");
}

private void button1_Click(object sender, EventArgs e)


{
if (dep.SelectedIndex == -1)
{
MessageBox.Show("please select department ");
}
else if (l2.SelectedIndex == -1)
{
MessageBox.Show("please select program");
}
else
{
MessageBox.Show("Your Department is " + dep.SelectedItem.ToString() + "\n" + "Your
Program is " + l2.SelectedItem.ToString());
}

}
}
}

You might also like