private void btnSubmit_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtStatus.Text) && !string.IsNullOrWhiteSpace(txtStatus.Text)) { //create a new DB instance DBUtility db = new DBUtility(); //write the new value to the database. db.AddNewEntry(txtStatus.Text); //hide the form and resume running in the taskbar. notifyIcon.Visible = true; txtStatus.Text = "Tell me your life story."; this.Hide(); } }