嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 20 元微信扫码支付:20 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
partial class frmUPCA : Form
{
private UpcA upc = null;
public frmUPCA( )
{
InitializeComponent( );
cboProductType.SelectedIndex = 0;
cboScale.SelectedIndex = 2;
}
private void CreateUPC( )
{
upc = new UpcA( );
upc.ProductType = cboProductType.Items [cboProductType.SelectedIndex].ToString( );
upc.ManufacturerCode = txtManufacturerCode.Text;
upc.ProductCode = txtProductCode.Text;
if( txtChecksumDigit.Text.Length > 0 )
upc.ChecksumDigit = txtChecksumDigit.Text;
}
private void butDraw_Click(object sender, EventArgs e)
{
System.Drawing.Graphics g = this.picBarcode.CreateGraphics( );
g.FillRectangle( new System.Drawing.SolidBrush( System.Drawing.SystemColors.Control ),
new Rectangle( 0, 0, picBarcode.Width, picBarcode.Height ) );
CreateUPC( );
upc.Scale = (float)Convert.ToDecimal( cboScale.Items [cboScale.SelectedIndex] );
upc.DrawUpcaBarcode( g, new System.Drawing.Point( 0, 0 ) );
txtChecksumDigit.Text = upc.ChecksumDigit;
g.Dispose( );
}
private void butPrint_Click(object sender, EventArgs e)
{
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument( );
pd.PrintPage = new System.Drawing.Printing.PrintPageEventHandler( this.pd_PrintPage );
pd.Print( );
}
private void pd_PrintPage( object sender, System.Drawing.Printing.PrintPageEventArgs ev )
{
CreateUPC( );
upc.Scale = ( float )Convert.ToDecimal( cboScale.Items [cboScale.SelectedIndex] );
upc.DrawUpcaBarcode( ev.Graphics, new System.Drawing.Point( 0, 0 ) );
txtChecksumDigit.Text = upc.ChecksumDigit;
// Add Code here to print other information.
ev.Graphics.Dispose( );
}
private void butCreateBitmap_Click(object sender, EventArgs e)
{
CreateUPC( );
upc.Scale = ( float )Convert.ToDecimal( cboScale.Items [cboScale.SelectedIndex] );
System.Drawing.Bitmap bmp = upc.CreateBitmap( );
this.picBarcode.Image = bmp;
}
}