Professional Documents
Culture Documents
Objective:
Show Date
Button show Date will show the Selected date of date time picker through message box
Show Time
Show time button will show the time from the date time picker through message box.
Break Apart
Break Apart will break the selected date in Day , Month and year and show the respected text boxes.
Visual programing (CS-692/CS-783)
Mr. Ikram Afzal email: ikram@biit.edu.pk Whatsapp#03345373093
Mr. Umar Farooq email: umar.farooq@biit.edu.pk Whatsapp#03327661819
TxtAddMonths
TxtNewDate
DateTimePicker2
btnCalculateAge
txtAge
Calculate Age
User will select the date of birth from the dateTimePicker2 and the Calculate
button will calculate the age in the days and show in the text Box txtAge.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace COMBOBOX
{
public partial class dateTimePickerExample : Form
{
public dateTimePickerExample()
{
InitializeComponent();
}
txtAge.Text=dateTimePicker1.Value.Subtract(dateTimePicker2.Value).TotalDays.T
oString();
}
Objective:
List Box:
listBox
lstbxSubject
lstbxSelected
Visual programing (CS-692/CS-783)
Mr. Ikram Afzal email: ikram@biit.edu.pk Whatsapp#03345373093
Mr. Umar Farooq email: umar.farooq@biit.edu.pk Whatsapp#03327661819
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace COMBOBOX
{
public partial class listViewExample : Form
{
public listViewExample()
Visual programing (CS-692/CS-783)
Mr. Ikram Afzal email: ikram@biit.edu.pk Whatsapp#03345373093
Mr. Umar Farooq email: umar.farooq@biit.edu.pk Whatsapp#03327661819
{
InitializeComponent();
}
}
else
{
string item = lstbxSubjects.SelectedItem.ToString();
lstbxSubjects.Items.RemoveAt(index);
lstbxSelected.Items.Add(item);
}
}
}
lstbxSubjects.Items.Clear();
}
lstbxSelected.Items.Clear();
}
}
}
Visual programing (CS-692/CS-783)
Mr. Ikram Afzal email: ikram@biit.edu.pk Whatsapp#03345373093
Mr. Umar Farooq email: umar.farooq@biit.edu.pk Whatsapp#03327661819