Avatar of cimcto
cimcto
 asked on

Start timer in DLL

Ok...I have created a DLL that does some communications with devices.  My problem is that I need to start a timer that I have on a hidden form in the DLL when my external program creates a new instances of the DLL.  How can you do that?
Visual Basic.NET

Avatar of undefined
Last Comment
cimcto

8/22/2022 - Mon
Kalpesh Chhatrala

Create Hidden Form Object and start Timer in Form Constructor.
ASKER CERTIFIED SOLUTION
Deepu Sreedhar

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Deepu Sreedhar

Whenever you want to use it ...
AddHandler TSTimer.Elapsed, AddressOf TSTimer_Tick
TSTimer.Enabled = True

Open in new window

cimcto

ASKER
I think I asked the question wrong.  I need to start the timer that is on a hidden form in my DLL project from a call that I make to the DLL from my Application that is talking to the DLL.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Jacques Bourgeois (James Burger)

Add a custom constructor to the class that needs to start the timer, something like the following:
Public Class Class1

	Public Sub New()

		Dim frm As New Form1
		frm.Timer1.Start()

	End Sub

End Class

Open in new window

cimcto

ASKER
This got me pointed in the right direction and I figured it out from there.