Home > Software engineering >  VB.net or C# : Want to write in the notification area [Windows]
VB.net or C# : Want to write in the notification area [Windows]

Time:11-06

I have a simple question How could I write some text with .NET in the notification area in Windows 10/11 ?

Something similar like that : (the ENG, I want exactly the same thing with the text I want) enter image description here

I precise I have all the rights so there is not problem to give admin permissions. If you have an idea, feel free to participate and help me Thanks Respectfully

CodePudding user response:

If you want to be able to freely type in there, you will have to draw your text and the convert them to icons then use a NotifyIcon and set the icon to your icon:

 Bitmap myBitmap = new Bitmap("blank.bmp");
 using (Graphics g = Graphics.FromImage(myBitmap))
 {
    g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
    g.DrawString("text", new Font("Arial", 8), Brushes.White, new PointF(0, 0));
 }
 myBitmap.Save("text.ico", System.Drawing.Imaging.ImageFormat.Icon);
 notifyIcon1.Icon = new Icon("text.ico");

Untested who knows if it would work, and delete the old icons when changing text.

  • Related