public frmTender(double Amount) { InitializeComponent(); _Amount = Amount; lblChange.Text = "Rs " + (0).ToString(); //AMOUNT_WITH_CURRENCY_SYMBOL string[] denoms = "100|10|5|1".Split('|'); // PAYMENT_DENOMINATIONS") foreach (string denomination in denoms) { if (string.IsNullOrEmpty(denomination.Trim())) { continue; } Button btnPaymentMode = new Button(); btnPaymentMode.FlatStyle = FlatStyle.Flat; btnPaymentMode.FlatAppearance.BorderSize = 0; btnPaymentMode.FlatAppearance.CheckedBackColor = Color.Transparent; btnPaymentMode.FlatAppearance.MouseDownBackColor = Color.Transparent; btnPaymentMode.FlatAppearance.MouseOverBackColor = Color.Transparent; btnPaymentMode.BackgroundImageLayout = ImageLayout.Zoom; btnPaymentMode.BackColor = Color.Transparent; btnPaymentMode.Tag = 0; btnPaymentMode.Name = "B" + denomination.Trim(); btnPaymentMode.Text = "Rs " + denomination.Trim(); btnPaymentMode.Click += btnPaymentMode_Click; btnPaymentMode.Size = btnSample.Size; btnPaymentMode.BackgroundImage = btnSample.BackgroundImage; btnPaymentMode.Font = btnSample.Font; btnPaymentMode.ForeColor = btnSample.ForeColor; btnPaymentMode.MouseDown += btnPaymentMode_MouseDown; btnPaymentMode.MouseUp += btnPaymentMode_MouseUp; flpTenders.Controls.Add(btnPaymentMode); } numPad = new NumberPad("#,##0.00", 2); //AMOUNT_FORMAT, RoundingPrecision numPad.handleaction(Amount.ToString()); numPad.NewEntry = true; Panel NumberPadVarPanel = numPad.NumPadPanel(); NumberPadVarPanel.Location = new System.Drawing.Point(2, 2); this.Controls.Add(NumberPadVarPanel); numPad.setReceiveAction = EventnumPadOKReceived; numPad.setKeyAction = EventnumPadKeyPressReceived; this.KeyPreview = true; this.KeyPress += new KeyPressEventHandler(FormNumPad_KeyPress); this.FormClosing += new FormClosingEventHandler(FormNumPad_FormClosing); }
void Awake() { //add a copy of TCPConnection to this game object myTCP = NetworkCode.GetComponent <TCPConnection> (); myNumberPad = gameObject.GetComponent <NumberPad> (); }
public void GivenIHaveEnteredIntoTheCalculator(int p0) { numberPad = new NumberPad(); numberPad.PressNumber(p0.ToString()); }