Isaacjweek3Ilab - Main form using System using...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Main form: 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 isaacJLab3 { public partial class lblSpeed : Form { private BindingList < Airplanes > myPlaneList = new BindingList < Airplanes >(); private Airplanes selectedPlane; public lblSpeed() { InitializeComponent(); } private void btnClose_Click( object sender, EventArgs e) { Application .Exit(); } Airplanes plane = new Airplanes (); public void createPlane() { Airplanes plane; string name; int x_coordinate; int y_coordinate; int direction; int speed; name = txtboxName.Text; x_coordinate = int .Parse(txtboxX.Text); y_coordinate = int .Parse(txtBoxY.Text); direction = int .Parse(txtBoxDirection.Text); speed = int .Parse(txtboxSpeed.Text); plane = new Airplanes (name, x_coordinate, y_coordinate, direction, speed); myPlaneList.Add(plane); selectedPlane = plane; setPlaneList(); } private void btnClear_Click( object sender, EventArgs e)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
{ txtboxName.Text = string .Empty; txtboxX.Text = string .Empty; txtBoxY.Text = string .Empty; txtBoxDirection.Text = string .Empty; txtboxSpeed.Text = string .Empty; } private void btnExit_Click( object sender, EventArgs e) { createPlane(); lblOperation.Text = "Plane created" ; } public void setPlaneList() { lstPlanes.DataSource = null ; lstPlanes.DataSource = myPlaneList; lstPlanes.DisplayMember = "Name" ; } private void lstPlanes_SelectedIndexChanged( object sender, EventArgs e) { try { selectedPlane = ( Airplanes )lstPlanes.SelectedValue; if (!(selectedPlane == null )) displayPlaneInformation();
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/21/2011 for the course CIS 276 276 taught by Professor Khabani during the Spring '11 term at DeVry Chicago.

Page1 / 7

Isaacjweek3Ilab - Main form using System using...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online