Show the number in minimized windows of your application in C #

In fact, I want something like skype. if someone sends two messages to skype; you see the number "2" in the minimized skype window. So, I want to know how I can show the number / quantity in a minimized window of your C # application?

+4
source share
1 answer

If you are using WPF, you can use the TaskbarButtonInfo.Overlay property .

// draw an image to overlay
var dg = new DrawingGroup();
var dc = dg.Open();
dc.DrawEllipse(Brushes.Blue, new Pen(Brushes.LightBlue, 1), new Point(8, 8), 8, 8);
dc.DrawText(new FormattedText("3", System.Threading.Thread.CurrentThread.CurrentUICulture, System.Windows.FlowDirection.LeftToRight,
    new Typeface("Arial"), 16, Brushes.White), new Point(4, 0));
dc.Close();
var geometryImage = new DrawingImage(dg);
geometryImage.Freeze();

// set on this window
var tbi = new TaskbarItemInfo();
tbi.Overlay = geometryImage;

this.TaskbarItemInfo = tbi;

Gives out
Taskbar button with an overlay of a circled number 3

If you are using Windows Forms, use the Windows Code Code Pack as described in this related question .

+1
source

All Articles