9/05/2013

Payment Form

C# Payment Form
Payment Form


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Billing
{
    public partial class frm_PrintBill : Form
    {
        public double balance=0,billamount=0,cashtendered=0;
        public frm_PrintBill()
        {
            InitializeComponent();
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        private void txt_CashTendered_KeyUp(object sender, KeyEventArgs e)
        {
            if(e.KeyCode==Keys.Enter)
            {
                if (txt_CashTendered.TextLength > 0)
                {
                    billamount = Convert.ToDouble(txt_Amount.Text);
                    cashtendered = Convert.ToDouble(txt_CashTendered.Text);
                    balance = cashtendered - billamount;
                    

                    txt_CashTendered.Text = string.Format("{0:0.00}", cashtendered);
                    txt_Balance.Text = string.Format("{0:0.00}", balance);
                    this.SelectNextControl(txt_CashTendered, true, true, true, true);
                }
                else
                {
                    return;
                }
               
            }
        }

        private void btn_Print_Click(object sender, EventArgs e)
        {
            if (txt_CashTendered.TextLength <= 0)
            {
                return;
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
    }
}

9/01/2013

Steps To Install Visual Basic PowerPack For Visual Studio 2013

If Visual Studio is running close it and click on Retry
Check "I agree to the License Terms and Privacy Policy" and click on INSTALL
Click on "Close" to finish the installation.
Open Visual Studio Windows Form Application and right click on toolbox and click on "Add Tab"


Download Visual Basic PowerPack