Вызов из другого класса (C# 2008)
<DIV id=post_message_297212>код C#
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Top = 50;
Left = 200;
Size = new System.Drawing.Size(1250, 908);
}
private void progressBar1_Click(object sender, EventArgs e)
{
timer1.Interval = 100;
timer1.Enabled = true;
timer1.Tick += new EventHandler(timer1_Tick);
Class1 class1 = new Class1();
class1.Method2(progressBar1);
}
private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.PerformStep();
}
}
public class Class1
{
public void Method2(System.Windows.Forms.ProgressBar pb)
{
Form1 frm1 = new Form1();
pb.Visible = true;
pb.Minimum = 0;
pb.Maximum = 50;
pb.Value = 0;
pb.Step = 1;
}
}
Как подключить таймер? </DIV>
|