Quote Originally Posted by Dragster93 View Post
I did that because otherwise, it would say, can't implicitely convert DateTime to Int.
You need to understand what DateTime.Now does. It makes an instance of the DateTime class and sets it to the current time. When you call Datetime.Now.Year, you are accessing the year property of the current date time instance. Since the Year property is declared as an integer, you don't need to convert it.

Quote Originally Posted by Dragster93 View Post
So what you're saying is that I should store the DateTime value in a variable and then use that variable rather than calling DateTime() everytime???
Yes. Everytime you call DateTime.Now you are creating a separate datetime instance. Just call it once.

Quote Originally Posted by Dragster93 View Post
Yes, I understood why it's freezing, that is why I tried to use the backgroundworker to do the calcuation in background. But I seem to be having a little trouble with it. I use 'backgroundworker.dispose()' to free the resources so that if the Set Alarm button is clicked a second time to set a different time, the it shouldn't display an exception saying, "The thread is busy". But that seems to work only for the second click. If you click the third time, again the same problem occurs. I shall try using the catch and throw exception for that problem and see if it works
You have something wrong with the background worker code. Post your background worker code.