using System;
using System.Windows.Forms;
namespace WindowsFormsApp2 {
public partial class Array : Form {
public Array( ) { InitializeComponent( ); }
private void addName( ) {
string[ ] studentName = new string[5];
for ( int i = 0; i < 5; i++ ) {
studentName[i] = Microsoft.VisualBasic.Interaction.InputBox(
"Enter the student name:" );
nameList.Items.Add( studentName[i] );
}
}
private void Start_Click( object sender, EventArgs e ) {
nameList.Items.Clear( );
addName( );
}
private void Exit_Click( object sender, EventArgs e ) {
Application.Exit( );
}
}
}
|