i need help her is my code
using System;
using System.Windows.Forms;
using System.Threading;
namespace DefaultNamespace
{
public partial class Form1 : System.Windows.Forms.Form
{
private Gary.Perkin.UserControls.vuMeterLED vuMeterLED2;
private Gary.Perkin.UserControls.vuMeterLED vuMeterLED3;
private Gary.Perkin.UserControls.vuMeterLED vuMeterLED4;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Timer timer1;
private Gary.Perkin.UserControls.vuMeterLED vuMeterLED1;
int cycleCount;
Random r = new Random();
[STAThread]
public static void Main(string[] args)
{
Application.Run(new Form1());
}
#region Windows Forms Designer generated code
public void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.vuMeterLED1 = new Gary.Perkin.UserControls.vuMeterLED();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.vuMeterLED4 = new Gary.Perkin.UserControls.vuMeterLED();
this.vuMeterLED3 = new Gary.Perkin.UserControls.vuMeterLED();
this.vuMeterLED2 = new Gary.Perkin.UserControls.vuMeterLED();
this.SuspendLayout();
vuMeterLED1.Location = new System.Drawing.Point(40, 72);
vuMeterLED1.Name = "vuMeterLED1";
vuMeterLED1.Size = new System.Drawing.Size(16, 123);
vuMeterLED1.TabIndex = 5;
vuMeterLED1.Volume = 0;
this.timer1.Enabled = true;
this.timer1.Interval = 500;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
this.button1.Location = new System.Drawing.Point(24, 16);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(56, 23);
this.button1.TabIndex = 1;
this.button1.Text = "Start";
this.button1.Click += new System.EventHandler(this.button1_Click);
this.button2.Location = new System.Drawing.Point(88, 16);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(56, 23);
this.button2.TabIndex = 4;
this.button2.Text = "Stop";
this.button2.Click += new System.EventHandler(this.button2_Click);
this.vuMeterLED4.Location = new System.Drawing.Point(112, 72);
this.vuMeterLED4.Name = "vuMeterLED4";
this.vuMeterLED4.Size = new System.Drawing.Size(16, 123);
this.vuMeterLED4.TabIndex = 8;
this.vuMeterLED4.Volume = 0;
this.vuMeterLED3.Location = new System.Drawing.Point(88, 72);
this.vuMeterLED3.Name = "vuMeterLED3";
this.vuMeterLED3.Size = new System.Drawing.Size(16, 123);
this.vuMeterLED3.TabIndex = 7;
this.vuMeterLED3.Volume = 0;
this.vuMeterLED2.Location = new System.Drawing.Point(64, 72);
this.vuMeterLED2.Name = "vuMeterLED2";
this.vuMeterLED2.Size = new System.Drawing.Size(16, 123);
this.vuMeterLED2.TabIndex = 6;
this.vuMeterLED2.Volume = 0;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(184, 245);
Controls.Add(vuMeterLED4);
this.Controls.Add(vuMeterLED3);
this.Controls.Add(vuMeterLED2);
this.Controls.Add(vuMeterLED1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Opacity = 0.99;
this.Text = "vuMeterLED Demo";
this.ResumeLayout(false);
}
#endregion
private void timer1_Tick(object sender, System.EventArgs e)
{
cycleCount++;
LightLEDs(cycleCount);
if (cycleCount == 4) cycleCount = 0;
}
private void LightLEDs(int count)
{
int sleepLength = 100;
int rSeed = 15;
if (count == 1)
{
for (int j = 5 + (r.Next(rSeed)); j >= 0; j--)
{
vuMeterLED1.Volume = j;
vuMeterLED1.Refresh();
Thread.Sleep(sleepLength / (j + 1));
}
}
if (count == 2)
{
for (int j = 5 + (r.Next(rSeed)); j >= 0; j--)
{
vuMeterLED2.Volume = j;
vuMeterLED2.Refresh();
Thread.Sleep(sleepLength / (j + 1));
}
}
if (count == 3)
{
for (int j = 5 + (r.Next(rSeed)); j >= 0; j--)
{
vuMeterLED3.Volume = j;
vuMeterLED3.Refresh();
Thread.Sleep(sleepLength / (j + 1));
}
}
if (count == 4)
{
for (int j = 5 + (r.Next(rSeed)); j >= 0; j--)
{
vuMeterLED4.Volume = j;
vuMeterLED4.Refresh();
Thread.Sleep(sleepLength / (j + 1));
}
}
}
private void button1_Click(object sender, System.EventArgs e)
{
timer1.Start();
}
private void button2_Click(object sender, System.EventArgs e)
{
timer1.Stop();
}
}
}
i keep getting the error
cs0111(type 'form 1' already defines a member'initialize component')
What I have tried:
it's funny because i just got rid of this line to fix cs0121
public Form1()
{
InitializeComponent();
}