Advertisement
nuggetin

sht2

Nov 11th, 2021
1,288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using StudentNamespace;
  11. using StudentInformationApplication;
  12.  
  13. namespace StudentInformationApplication
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.        
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         private void btn_submit_Click(object sender, EventArgs e)
  24.         {
  25.             StudentInfo student = new StudentInfo(tb_sid.Text, tb_ln.Text, tb_fn.Text);
  26.  
  27.             if (student.validate())
  28.             {
  29.                 lb_sid.Items.Add(student.Sid);
  30.                 lb_ln.Items.Add(student.Lname);
  31.                 lb_fn.Items.Add(student.Fname);
  32.             }
  33.             else
  34.             {
  35.                 MessageBox.Show("Check your input", "text box values error");
  36.             }
  37.         }
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement