Hola.
Estuve probando y de pronto te sirve este código.
Pruébalo y comenta como te fue.
La DLL
Código:
using System;
using System.Windows.Forms;
namespace Contador
{
public class contador
{
private Timer objtimer = new Timer();
private TextBox txt;
public contador(TextBox textBox)
{
Segundos = 0;
objtimer.Start();
objtimer.Tick += new EventHandler(objtimer_Tick);
objtimer.Interval = 100;
txt = textBox;
}
void objtimer_Tick(object sender, EventArgs e)
{
Segundos++;
txt.Text = Segundos.ToString();
}
private int Segundos { get; set; }
}
}
codigo en el formulario que usa la dll
Código:
using System;
using System.Windows.Forms;
using Contador;
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
contador obj = new contador(this.textBox1);
}
}
}