Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TbUser.Focus();
     // string CS = "data source=.; database = Sample; integrated security=SSPI";
     // SqlConnection con = new SqlConnection(CS);
     // SqlCommand cmd = new SqlCommand("Select * from ");
 }
Beispiel #2
0
        private void TbUser_TextChanged(object sender, EventArgs e)
        {
            string context  = TbUser.Text;
            bool   isletter = true;

            //for loop checks for letters as characters are entered
            for (int i = 0; i < context.Length; i++)
            {
                if (!char.IsLetter(context[i])) // if current character not a letter
                {
                    isletter = false;           //make isletter false
                    break;                      // exit the for loop
                }
            }

            // if not a letter clear the textbox and focus on it
            // to enter name again
            if (isletter == false)
            {
                TbUser.Clear();
                TbUser.Focus();
            }
            else
            {
                BtnStart.Enabled = true;
            }
        }
Beispiel #3
0
 private void LoginWindow_Loaded(object sender, RoutedEventArgs e)
 {
     TbUser.Focus();
     //cmbTest.Items.Clear();
     //cmbTest.Items.AddRange(ass.Select(c => c.ACCOUNT_NO).ToArray());
 }