Advertisement
monaliza86

Display Button

Feb 26th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.47 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.  
  11. namespace Indexers
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void textBox2_TextChanged(object sender, EventArgs e)
  21.         {
  22.  
  23.         }
  24.  
  25.         private void btnDisplay_Click(object sender, EventArgs e)
  26.         {
  27.          
  28.             Invoice inv = new Invoice(txtInvoiceNumber.Text, txtDescription.Text, int.Parse(txtQuantity.Text), Convert.ToDecimal(txtPrice.Text));
  29.             InvoiceList myList = new InvoiceList();
  30.  
  31.             myList.Add(inv);
  32.             decimal x = myList[0].GetInvoiceAmount();
  33.             txtOutput.Text += inv.ToString() + " , " + " Invoice Amount is: " + x.ToString("c")+ "\r\n";
  34.            
  35.  
  36.         }
  37.  
  38.         private void Form1_Load(object sender, EventArgs e)
  39.         {
  40.            
  41.  
  42.      
  43.            
  44.  
  45.         }
  46.  
  47.         private void btnExit_Click(object sender, EventArgs e)
  48.         {
  49.             string message = "Are you sure you want to close the form ?";
  50.  
  51.             DialogResult button = MessageBox.Show(message, "Confirm",
  52.                 MessageBoxButtons.YesNo);
  53.             if (button == DialogResult.Yes)
  54.             {
  55.                 this.Close();
  56.             }
  57.  
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement