Categories
Software

Writing a WPF Alarm Application for Windows

VB.NET WPF Alarm for Windows

VB.NET is one of my favorite languages. Windows lacks a native Alarm application and this has been the case for quite some time. So here’s me coding a very simple and basic Alarm based on the .NET platform for Windows. I have decided to stick to making a WPF Alarm rather than a WinForms version. That is just because I want to make it look cool without using a lot of external image resources. But I will get to that later.

So here’s how it looks.

WPF Alarm Winten Alarm

So, as you can see, the application design is base basic. Naturally putting it into code did not take much time.

The Biggest Challenge

It was actually a combination of two factors. One was that I was out of touch with .NET for quite some time. So getting back took some time. Second, the nitty Timer control that you can use easily in WinForms was simply not available. A bit of Googling yielded results and I decided to go with an apparently more efficient and beautiful DispatcherTimer object. This was not an user control but a full sub class of System.Windows.Threading. So I assume it’s pretty powerful.

Once that was sorted out, I added a handler to a tick event that I manually created. Then I was set. All I needed to do was get some free sounds. I headed straight here to get some royalty free sound samples that would basically be the Alarming note! Needless to say I added a full blown siren as the default sound. You can change or replace it if you know some simple coding. I will add a user friendly interface to this WPF alarm to choose your own sounds soon though.

VB.NET WPF Alarm for Windows VB.NET is one of my favorite languages. Windows lacks a native Alarm application and this has been the case for quite some time. So here's me coding a very simple and basic Alarm based on the .NET platform for Windows. I have decided to stick to making a WPF Alarm rather than a WinForms version. That is just because I want to make it look cool without using a lot of external image resources. But I will get to that later. So here's how it looks. WPF Alarm Winten Alarm So, as you can see, the application design is base basic. Naturally putting it into code did not take much time. The Biggest Challenge It was actually a combination of two factors. One was that I was out of touch with .NET for quite some time. So getting back took some time. Second, the nitty Timer control that you can use easily in WinForms was simply not available. A bit of Googling yielded results and I decided to go with an apparently more efficient and beautiful DispatcherTimer object. This was not an user control but a full sub class of System.Windows.Threading. So I assume it's pretty powerful. Once that was sorted out, I added a handler to a tick event that I manually created. Then I was set. All I needed to do was get some free sounds. I headed straight here to get some royalty free sound samples that would basically be the Alarming note! Needless to say I added a full blown siren as the default sound. You can change or replace it if you know some simple coding. I will add a user friendly interface to choose your own sounds soon though. The Source Code So here is the source code for WPF WinTen Alarm. If you want the Setup file you can download from here. I obviously don't wish to end this here. I would like this to be an Alarm manager where you can set alarms and then attach notes to them as well. I will need to brush up my skills in ADO or something similar. Let me know if you have better ideas than those in the code. I have kept the structure easy to read and use so things remain self explanatory. Also please do let me know in the comments below if you stumble on any bugs that you may face while using this open source WinTen Alarm.
You can download the 7z file below and check the code out with Visual Studio

The Source Code

So here is the source code for WPF WinTen Alarm. If you want the Setup file you can download from here.

I obviously don’t wish to end this here. I would like this to be a WPF Alarm manager where you can set alarms and then attach notes to them as well. I will need to brush up my skills in ADO or something similar. Let me know if you have better ideas than those in the code. I have kept the structure easy to read and use so things remain self explanatory. Also please do let me know in the comments below if you stumble on any bugs that you may face while using this open source WPF Alarm app.


By Sarthak Ganguly

A programming aficionado, Sarthak spends most of his time programming or computing. He has been programming since his sixth grade. Now he has two websites in his name and is busy writing two books. Apart from programming, he likes reading books, hanging out with friends, watching movies and planning wartime strategies.

Leave a Reply

Your email address will not be published. Required fields are marked *