Lecture 2 2nd Course C#
Lecture 2 2nd Course C#
}
Date Time Picker
The DateTimePicker control allows you to display and collect date and time
from the user with a specified format.
Menu Control
A Menu on a Windows Form is created with a MainMenu object, which is a
collection of MenuItem objects. MainMenu is the container for the Menu
structure of the form and menus are made of MenuItem objects that represent
individual parts of a menu. You can add menus to Windows Forms at design
time by adding the MainMenu component and then appending menu items to
it using the Menu Designer. After drag the Menustrip on your form you can
directly create the menu items by type a value into the "Type Here" box on the
menubar part of your form. From the following picture you can understand how
to create each menu items on main menu Object.
Timer & Progress Bar
Progress Bar is a control that an application can use to indicate the progress of
a lengthy operation such as calculating a complex result, downloading a large
file from the Web etc. ProgressBar controls are used whenever an operation
takes more than a short period of time. The Maximum and Minimum properties
define the range of values to represent the progress of a task.
The Timer Control plays an important role in the development of programs both
Client side and Server side development as well as in Windows Services. With
the Timer Control we can raise events at a specific interval of time without the
interaction of another thread.
Example 3: Write a Windows based application to design the form below:
private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.Value = progressBar1.Value + 10;
label1.Text = "%"+ progressBar1.Value.ToString();
if(progressBar1 .Value ==100)
{
Application.Exit();
}}