-1-
-2-
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 invoice01
{
public partial class invo : Form
{
public invo()
{
InitializeComponent();
}
private void invo_Load(object sender, EventArgs e)
{
txtdate.Text = DateTime.Now.ToString("yyyy/MM/dd");
txtcust.Select();
// txtcust.Focus();
}
private void txtdate_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true; // يمنع التعاممل مع لوحة المفاتيح وليس الماوس
}
private void txtdate_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button==MouseButtons.Right)
{
txtdate.ContextMenu = new ContextMenu();// new empty menu
}
}
private void txttotal_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true; // يمنع التعاممل مع لوحة المفاتيح وليس الماوس
}
private void label9_Click(object sender, EventArgs e)
{
}
private void txtcust_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData==Keys.Enter)
{
cbxitem.Focus();
}
}
private void cbxitem_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter)
{
txtqty.Focus();
}
}
private void txtprice_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true; // يمنع التعاممل مع لوحة المفاتيح وليس الماوس
}
private void btnadd_Click(object sender, EventArgs e)
{
MessageBox.Show("add");
}
private void txtqty_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter)
{
btnadd.PerformClick();
cbxitem.Focus();
}
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void label5_Click(object sender, EventArgs e)
{
}
}
}
-3-
-4-