mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-09-29 08:41:12 +13:00
50231f5a3c
[Feature] Show icon in taskbar when application is running #115
26 lines
630 B
C#
26 lines
630 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,
|
|
screen.Bounds.Bottom + 80); //Hide below taskbar
|
|
}
|
|
}
|
|
}
|