The name is NextPanelStopwatch. To start it you do
NextPanelStopwatch.Start
Just make sure you declare it where it won't go out of scope.
Reverend Jim
Carpe per diem
3,605 posts since Aug 2010
Reputation Points: 561
Solved Threads: 449
Skill Endorsements: 32
or any other solution if my way is too stupid
I would not say its stupid, just not well thought out. :)
Look at what you wrote as one of your goals: " Later in that form when user clicks on the panel stopwatch must start".
To accomplish this, you will be handling the panel's "Click" event. That has nothing to do with the name that you would assign to the Stopwatch ****if it had a Name property. ****
What you do need however is a reference to the StopWatch so that you can start and stop it. All Controls have a "Tag" Property, so you could assign the StopWatch to the Panel's Tag.
However this is just plain messy and hard to maintain. I suggest that you consider creating a UserControl instead. It would house it's own timer and Click logic. Then you would just add an instance of that instead of the panel to your form.
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13
Technically that not its name. That's just a reference to it. Consider
Dim sw1 As New StopWatch
Dim sw2 As StopWatch = sw1
sw1 and sw2 are both references to the same object but neither is the object's name. For most controls, Name is an actual property of the object (intrinsic). sw1 and sw2 exist separately from the object (extrinsic). When you destroy the object, sw1 and sw2 continue to exist.
Reverend Jim
Carpe per diem
3,605 posts since Aug 2010
Reputation Points: 561
Solved Threads: 449
Skill Endorsements: 32