Is there a way to recognize the position of system tray in c# winforms?
I want to create a form that will place above or below the system tray depends on where the system tray is the position.
I am planning to create a custom form instead of a context menu since I need to enhance the UI but I am confused about how will position my form above/below the system tray.
I attached the image of how I imagine my form will be position.
I tried to look at your references and I had an idea based on that and here is the fix:
Code snippet for position your form via mouse position
var form = new Form1();
form.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
form.SetDesktopLocation(MousePosition.X - form.Width / 2, MousePosition.Y - form.Height - 20);
form.Show();
form.Activate();
form.TopMost = true;