Class and Self Dying Instance Objects

raklali 236 Reputation points
2022-01-19T13:40:23.593+00:00

A weird thought... Can it be implemented?

If a class is defined with a Timer to manages a property of an object/control within the same class, can the instance of such class be destroyed/ Disposed after certain condition is achieved during the period the timer is active. For example, Can the instance of a class be disposed from within the Class method after say, Timer.Enabled = False occurs?

Developer technologies VB
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2022-01-20T06:16:12.543+00:00

    Hi @raklali ,
    Here is a C# based idea that might help you.
    Is it possible for instance to destroy/delete self?
    If you have questions about it, you can also post here.
    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.