Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27235

Activate a Timer that is Inside a User Control

$
0
0
What I have is a custom made user control, which includes within it a couple of buttons, a textbox, a couple labels, and a timer.
Essentially in this control you have one button that starts the timer and one button that stops the timer.

I am then adding multiple of these controls to my main form dynamically. However, I can't seem to activate the timer in these user controls.

I have tried
UserControl.Controls("timer").Enabled = True

When that is executed however I get a Null Reference Exception error.

So my question being is there some other syntax that I must use to active that timer? Or is it just not possible? If its not possible, would it be possible to call the click event for the button in the user control that starts the timer?

Thanks in advance for the help.

Viewing all articles
Browse latest Browse all 27235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>