How to change button color of form1 by using button of form2SSshanawaz sayyed9yAsked Oct 9, 2017, 11:20 AM871Visual Basic .NETplzz help
Nithya Mathan9y agoPosted Oct 9, 2017, 11:47 AMYou could try this:In form2 create a Property called ButtonColor public Color ButtonColor = new Color();in the form2_paint method add the following Button1.BackColor = ButtonColor; Button2.BackColor = ButtonColor; Button3.BackColor = ButtonColor; Change form1 to Form2 form2 = new Form2(); private void Klik_Click(object sender, EventArgs e) { counter++; if(counter==1) { Button1.BackColor = Color.Red; Button2.BackColor = Color.Red; Button3.BackColor = Color.Red; form2.ButtonColor = Color.Red; } if (counter > 1) { Button1.BackColor = Color.Green; Button2.BackColor = Color.Green; Button3.BackColor = Color.Green; form2.ButtonColor = Color.Green; counter = 0; } form2.Show(); form2.Refresh(); } I think this will help you!!!0
Nithya MathanPosted Oct 9, 2017, 11:47 AM
You could try this:In form2 create a Property called ButtonColor public Color ButtonColor = new Color();in the form2_paint method add the following