mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-09-29 16:51:18 +13:00
8bdbb83e06
[Feature] Show icon in taskbar when application is running #115
29 lines
779 B
C#
29 lines
779 B
C#
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace SystemTrayMenu.UserInterface
|
|
{
|
|
public partial class TaskbarForm : Form
|
|
{
|
|
public TaskbarForm()
|
|
{
|
|
InitializeComponent();
|
|
SetLocation();
|
|
}
|
|
|
|
private void TaskbarForm_LocationChanged(object sender, System.EventArgs e)
|
|
{
|
|
SetLocation();
|
|
}
|
|
|
|
private void SetLocation()
|
|
{
|
|
Screen screen = Screen.PrimaryScreen;
|
|
Location = new Point(screen.Bounds.Right - Size.Width,
|
|
//we could show behind taskbar?
|
|
//screen.Bounds.Bottom- Size.Height);
|
|
//but at the moment we dont want to see this
|
|
screen.Bounds.Bottom + 80); // - Size.Height);
|
|
}
|
|
}
|
|
}
|