You are on page 1of 3

Hng dn lm Assigment Bi 1 : ( Basic Controls )

1. Giao din thit k nh hnh 2. Validation cho cc fields u phi nhp. TextBox

MaskTextBox

Khi b trng 1 field ( th d : Name khi focus vo field khc s c thng bo li v cho focus v cn nhp)

Ch : thay i 1 s fields cho ph hp vi bn a Khng c State Khi nhn submit s c 1 MessageBox hin th y thng tin va nhp. Quy nh ca maskTextBox Phone l 000-0000000 ComboBox Country ch cha 2 nc VietNam v Thailan ( cha 3 thnh ph Pattaya,ChiengMai v Bankok)

Hint : da vo event Leave ca control


// Validates the name of employee validation d liu nhp. private void txtEmployeeName_Leave(object sender, EventArgs e) { if (txtEmployeeName.Text == "") { MessageBox.Show("Please enter employee name.", "Employee Details", MessageBoxButtons.OK, MessageBoxIcon.Error); txtEmployeeName.Focus(); } } // Validates the birth date of employee private void msktxtDateofBirth_Leave(object sender, EventArgs e) { if (msktxtDateofBirth.Text == " / /") { MessageBox.Show("Please enter date of birth.", "Employee Details", MessageBoxButtons.OK, MessageBoxIcon.Error); msktxtDateofBirth.Focus(); } }

Khi nhn LinkLabel s chuyn n vnexpress.net

Yu cu khi chm bi Assigment ny : Chm v Giao din. (40%) Chm v Validation (40%)

Chm v hin th khi nhn Submit (20%)

You might also like