private void Cb_publisher_SelectedIndexChanged(object sender, EventArgs e) { int last_index = cb_publisher.Items.Count - 1; if (cb_publisher.SelectedIndex == 0) { cb_publisher.ForeColor = Color.Gray; } else if (cb_publisher.SelectedIndex == last_index) { main_page.Create_Add_Publisher_Form(); string query = string.Format("Select {0}.NAME From {0}", "Publishers"); DataTable dt = DataBaseEvents.ExecuteQuery(query, data_source); int rows_count = dt.Rows.Count; if (rows_count <= 0) { return; } cb_publisher.Items.Clear(); cb_publisher.Items.Add("Publisher's Name"); for (int i = 0; i < rows_count; i++) { string item = dt.Rows[i][0].ToString(); cb_publisher.Items.Add(item); } cb_publisher.Items.Add("Add new Publisher"); cb_publisher.SelectedIndex = 0; } else { cb_publisher.ForeColor = Color.LightGray; } }