private void Add_Click(object sender, EventArgs e) { if (Valor.Text.Trim() == "") { MessageBox.Show("Atenção é necessário informar o valor"); Valor.Focus(); } else if (Descricao.Text.Trim() == "") { MessageBox.Show("Atenção é necessário informar a descrição"); Descricao.Focus(); } else { if (RadioCheckGroup.Text == "" && cb_TP_Dado.Text == "CHECKBOX") { RadioCheckGroup.AppendText(Valor.Text + ":" + Descricao.Text + ";"); } else if (cb_TP_Dado.Text == "RADIO") { RadioCheckGroup.AppendText(Valor.Text + ":" + Descricao.Text + ";"); } Valor.Focus(); } }
private void cb_TP_Dado_SelectedIndexChanged(object sender, EventArgs e) { if ((vTP_Modo == TTpModo.tm_Edit) || (vTP_Modo == TTpModo.tm_Insert)) { if (cb_TP_Dado.Text == "RADIO") { Valor.Enabled = true; Descricao.Enabled = true; RadioCheckGroup.Enabled = true; Add.Enabled = true; bb_Limpar.Enabled = true; RadioCheckGroup.ReadOnly = true; RadioCheckGroup.Size = new Size(400, 40); Valor.Focus(); } else if (cb_TP_Dado.Text == "CHECKBOX") { Valor.Enabled = false; Descricao.Enabled = false; RadioCheckGroup.Enabled = true; RadioCheckGroup.ReadOnly = false; Add.Enabled = false; bb_Limpar.Enabled = false; RadioCheckGroup.Size = new Size(200, 20); RadioCheckGroup.Focus(); } else { Valor.Enabled = false; Valor.Text = ""; Descricao.Enabled = false; Descricao.Text = ""; RadioCheckGroup.Enabled = false; RadioCheckGroup.ReadOnly = true; RadioCheckGroup.Size = new Size(400, 40); RadioCheckGroup.Text = ""; Add.Enabled = false; bb_Limpar.Enabled = false; groupBoxBusca.Focus(); } //(BS_ParamClasse.Current as TRegistro_Cad_ParamClasse).TP_Dado = cb_TP_Dado.Text; //BS_ParamClasse.ResetBindings(true); } }