Sunday, 9 October 2016

My Winform "HTML Toast Notification" Library

The other day/week/month (gee, where does the time go!), I wanted to include toast style notifications inside a Winform's application I was working on.

Basically, I wanted some kind of on-screen-display (OSD) that notifies the user when an event happens in the app. I also wanted something non-obtrusive so the user didn't have to interact with it (for example, clicking a button to dismiss it).

The only thing was... I couldn't find anything out there that suited my needs.

So, I wrote my own!

After playing around with some web-based toast notifications, I thought it would be neat to be able to display any HTML in a transparent window. After a bit of research, an article on CodeProject helped me to display a transparent window in C#.

From there, I added my own code to display HTML in the window using the excellent HTML Renderer library found here!

This is what I ended up with:

  • You can display any HTML at any location on the screen.
  • You can display any image inside your project.
  • You can display base64 png images inside your HTML.
  • You can specify a timeout for the toast notification.

You can find the code for the sample project on my github page.

Check it out here: https://github.com/OceanAirdrop/WinformsHTMLToastNotification


Contact Me:  ocean.airdrop@gmail.com

Popular Posts

Recent Posts

Unordered List

Text Widget

Pages