0
Have:
- 2 Radiobutton
- 1 Combobox
- 1 Textbox
The value of radiobutton chosen goes to the TextBox plus the value of Combobox.
TextBox = RadioButton + Combobox
But if I change, the value of Radiobutton, the Textbox does not change, is changing the value of Textbox if you change Radiobutton or Combobox.
Code:
private void combobox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (radiobutton1.Checked && combobox1.Text == "Cerfificação (CER)")
{
textbox1.Text = "CER" + " SRV";
}
if (radiobutton1.Checked && combobox1.Text == "Desenvolvimento (DES)")
{
textbox1.Text = "DES" + " SRV";
}
if (radiobutton2.Checked && combobox1.Text == "Desenvolvimento (DES)")
{
textbox1.Text = "DES" + " CLI";
}
No friend @Meuchapeu, so don’t give me...
– Don Vito
Why? Some mistake happens?
– MeuChapeu
@Godfathersantana, I made a change to the code, so it’s only working when you change it to
comboboxif you want to change when you changeRadioButtonwill need to have an event ofCheckedin theRadioButtonto change when a change is made toRadioButton.– MeuChapeu
Friend @Meuchapeu, I need both, IE when it changes
RadioButtonandCombobox.– Don Vito
@Godfathersantana, Yes only implements the event
CheckedofRadioButtonand validate(IFs)no event. as was done in the event ofComboBoxwhen the selection is changed.– MeuChapeu
Already got it, thanks friend @Meuchapeu!
– Don Vito