Hi frnds i am facing an error while debugging the below mentioned program. The program is to generate barcode. I am mentioning the code below pls help;
namespace Bcode
{
public partial class Form1 : UserControl
{
private AlignType align = AlignType.Center;
private string alphabet39 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*";
private string code = "1234567890";
private string[] coded39Char = new string[] {
"000110100", "100100001", "001100001", "101100000", "000110001", "100110000", "001110000", "000100101", "100100100", "001100100", "100001001", "001001001", "101001000", "000011001", "100011000", "001011000",
"000001101", "100001100", "001001100", "000011100", "100000011", "001000011", "101000010", "000010011", "100010010", "001010010", "000000111", "100000110", "001000110", "000010110", "110000001", "011000001",
"111000000", "010010001", "110010000", "011010000", "010000101", "110000100", "011000100", "010101000", "010100010", "010001010", "000101010", "010010100"
};
private Container components = null;
private Font footerFont = new Font("Courier", 8f);
private Font headerFont = new Font("Courier", 18f);
private string headerText = "BarCode Demo";
private int height = 50;
private int leftMargin = 10;
private Panel panel1;
private PrintDocument printDocument1;
private bool showFooter;
private bool showHeader;
private int topMargin = 10;
private BarCodeWeight weight = BarCodeWeight.Small;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
//ERROR ABOVE
}
public Form1()
{
InitializeComponent();
}
private void BarCodeCtrl_Resize(object sender, EventArgs e)
{
this.panel1.Invalidate();
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.printDocument1 = new System.Drawing.Printing.PrintDocument();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.Window;
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(302, 228);
this.panel1.TabIndex = 0;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// printDocument1
//
this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
//
// Form1
//
this.ClientSize = new System.Drawing.Size(302, 228);
this.Controls.Add(this.panel1);
this.Name = "Form1";
this.Resize += new System.EventHandler(this.BarCodeCtrl_Resize);
this.ResumeLayout(false);
}
When i run this i am getting an error "Cannot convert from Bcode.Form1 to system.windows.forms.form