Thursday, 14 August 2014

how to restrict minimum char in C#

   private void txtInvoiceNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (txtInvoiceNo.Text.Length > 29 && e.KeyChar != 8)
            {
                LOCK(sender, e);
                MessageBox.Show("30 Charactors Allowed", "Exceeding 30 Charactors");
            }
        }

No comments:

Post a Comment