private void FormaPagamentoVendas_Load(object sender, EventArgs e) { try { this.MinimumSize = new Size(this.Width, this.Height); objFor = new FormaPagamentoBLL(); DataTable tab = objFor.localizarComRetorno("", "fp_codigo"); panFormaPagamento.AutoScroll = true; for (int i = 0; i < tab.Rows.Count; i++) { rb = new RadioButton(); rb.Text = tab.Rows[i][1].ToString(); rb.Name = tab.Rows[i][0].ToString(); rb.Location = new Point(20, posVert); //rb.Left = 20; rb.Top = posVert; rb.Width = 250; rb.Height = 50; rb.Font = new Font("Tahoma", 14, FontStyle.Bold); //rb.Tag = fileArray[i]; // Assuming you have your files in an array or similar rb.CheckedChanged += new System.EventHandler(this.Radio_CheckedChanged); posVert = posVert + 50; panFormaPagamento.Controls.Add(rb); //gbFormaPagamento.Controls.Add(rb); //lbFormaPagamento.Controls.Add(rb); } objFor = null; tab = null; } catch (Exception ex) { MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }
public frmFormasPagamento(IFormaPagamentoService service) { InitializeComponent(); formaPagamentoBLL = new FormaPagamentoBLL(service); popularGrid(); }