I'm aware of the break word, although I'm planning to use return to exit the function completey, a timer with getasynckeystate is activating the function once again. But I need it to break whenever. The function does a couple of things and is time consuming, it doesn't execute within a tight loop.
I was thinking like maybe putting the code into a seperate thread (backgroundworker) and then stopping that backgroundworker... but cross threading is annoying and very troublesome... Is there a way just to stop a function? like Function().Stop?