private void Button1_Click(object sender, eventargs e) { if (!bgw.IsBusy) { bgw.RunWorkerAsync(); } }
public void comboBoxEditBrand_SelectedItemChanged(object sender, eventargs e) // fired as control is changed { //error here!! if (comboBoxEditBrand.SelectedItem == SomeBrandItem) //<- this is where the error is thrown!! check for null first! { //do something } }
// assuming here you have three textboxes private void button1_Click(eventargs etc) { OtherForm otherForm = new OtherForm() { Text1 = textbox1.Text, Text2 = textbox2.Text, Text3 = textbox3.Text }; otherForm.Show(); }
private void btnedit_Click(object sender, eventargs e) { If(listView.SelectedItems.Count > 0) { string text1 = listView.SelectedItems(0).SubItems(1).Text; string text2 = listview.SelectedItems(0).SubItems(2).Text; Form2 frm2 = new Form2(); frm2.Name = text1; frm2.phonenumber = text2; frm2.Show(); this.Hide(); //// if you want to hide the form1 } }
private void nextquestion_click(object sender, eventargs e) { for (int i = 1; i <= questions.Count; i++) { int nextQuestionNo = ((currentQuestion.No + i) % questions.Count); if (!questions[nextQuestionNo].isAnswered) { //next unanswered question found. set that as current question //then stop loop currentQuestion = questions[nextQuestionNo]; break; } } //TODO: update the UI to show currentQuestion }
private void btnedit_Click(object sender, eventargs e) { for (int i = 0; i < lv.Items.Count; i++) { // is i the index of the row you selected? if (lv.Items[i].Selected == true) { //I show here the second field text (SubItems[1].Text) from the selected row(Items[i]) Message.Show(lv.Items[i].SubItems[1].Text); break; } } Form2 frm2 = new Form2(); frm2.Name= text1; frm2.phonenumber = text2; frm2.Show(); this.Hide(); //// if you want to hide the form1 }
void Login(object sender, eventargs e) { //Do something on button click }
private void CheckIfOnTenthItem(object sender, eventargs e) {