narrative report in c# programming

Topics: Programming language, List, Case study Pages: 6 (607 words) Published: December 1, 2013
NARRATIVE REPORT IN
C# PROGRAMMING
(Case Study)

CASE PROBLEM:

Design and develop a simple program that demonstrates how to preload a collection of items into List box 1. The program should be able to display one or more selected items on another list box. Follow the given figure below in designing and developing the application program.

Case Problem Description

A list of low-level and high-level programming languages is in the first listbox.The problem is to preload or transfer the selected items onthe second list box, which will be choosen by the customer of the said establishment. Sorting is not necessary.

Form Lay-out Design
Complete Coding
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e) {
Form2 frm2 = new Form2();
{

if ((textBox1.Text == "ARLYN") && (textBox2.Text == "DELEON")) frm2.Show();

else
MessageBox.Show("Incorrect USERNAME or PASSWORD"); this.Show();
}
textBox1.Text = "";
textBox2.Text = "";

}

private void label2_Click(object sender, EventArgs e) {

}

private void label1_Click(object sender, EventArgs e) {

}
}
}

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 WindowsFormsApplication1
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}

private void Form2_Load(object sender, EventArgs e)
{
listBox1.Items.Add("STrawberry");
listBox1.Items.Add("Chocolate Vanilla");
listBox1.Items.Add("Cappuccino Decaf");
listBox1.Items.Add("Coffe Float");
listBox1.Items.Add("Evian");
listBox1.Items.Add("Viva");
listBox1.Items.Add("Orangina");
listBox1.Items.Add("Snapple");
listBox1.Items.Add("Sol");
listBox1.Items.Add("Strawberry");
listBox1.Items.Add("Strawberry");

}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e) {
//Add the item to the other List box
listBox2.Items.Add(listBox1.Text);
listBox2.Items.Remove(listBox2.Text);
//Remove the item from this List box
listBox1.Items.Remove(listBox1.SelectedItem);
}

private void listBox2_SelectedIndexChanged(object sender, EventArgs e) {
//Add the itme to the other List box
listBox1.Items.Add(listBox2.Text);
listBox1.Items.Remove(listBox1.Text);
//Remove the item from this List box
listBox2.Items.Remove(listBox2.SelectedItem);
}

private void button1_Click(object sender, EventArgs e) {
Form2.ActiveForm.Close();

}
}
}

Compiling & Testing Error Description

Debugging/Checking of Program
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) {
//Add the item to the other List box...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • narrative report Essay
  • narrative report Essay
  • Programming in C# Essay
  • Essay about Programming C++
  • programming C Essay
  • A Project Report On C Programming Essay
  • Narrative Report Essay
  • Narrative Report Essay

Become a StudyMode Member

Sign Up - It's Free