private void mcbCode_SelectedIndexChanged(object sender, EventArgs e) { try { if (mcbCode.SelectedIndex == 0) { if (txtID.Text.Length > 0) { GeradorCode.QRCode code = new GeradorCode.QRCode(); ptbCodeID.Image = code.GerarQRCode(txtNome.Text, CorCode); } } if (mcbCode.SelectedIndex == 1) { if (txtID.Text.Length > 0) { GeradorCode.BarCode code = new GeradorCode.BarCode(); ptbCodeID.Image = code.GerarBarCode(txtNome.Text, CorCode); } } } catch (Exception ex) { } }
private void btnColorCode_Click(object sender, EventArgs e) { ColorDialog color = new ColorDialog(); if (color.ShowDialog() == DialogResult.OK) { if (mcbCode.SelectedIndex == 0) { GeradorCode.QRCode code = new GeradorCode.QRCode(); CorCode = color.Color; ptbCodeID.Image = code.GerarQRCode(txtID.Text, CorCode); } if (mcbCode.SelectedIndex == 1) { GeradorCode.BarCode barcode = new GeradorCode.BarCode(); CorCode = color.Color; ptbCodeID.Image = barcode.GerarBarCode(txtID.Text, CorCode); } } }