private void SetupNotificationsControl() { Control parent = advancedAreaContainer.Panel1; const int ControlOffset = 2; const int ControlHeight = 143; const int ControlWidth = 320; this.notificationsControl = new NotificationsControl() { Visible = false, Height = ControlHeight, Width = ControlWidth, Parent = parent, Anchor = AnchorStyles.Right | AnchorStyles.Bottom }; notificationsControl.NotificationsChanged += notificationsControl1_NotificationsChanged; notificationsControl.NotificationAdded += notificationsControl1_NotificationAdded; if (OSVersionPlatform.GetGenericPlatform() == PlatformID.Unix) //adjust for different metrics/layout under OS X/Unix notificationsControl.Width += 50; //base this on control.Width, not ControlWidth notificationsControl.Left = parent.Width - notificationsControl.Width - ControlOffset; //same here notificationsControl.Top = parent.Height - notificationsControl.Height - ControlOffset; }
private void SetupNotificationsControl() { notificationsControl = new NotificationsControl(); notificationsControl.Visible = false; notificationsControl.Height = 143; notificationsControl.Width = 320; notificationsControl.NotificationsChanged += notificationsControl1_NotificationsChanged; notificationsControl.NotificationAdded += notificationsControl1_NotificationAdded; notificationsControl.Parent = advancedAreaContainer.Panel1; const int offset = 2; if (OSVersionPlatform.GetGenericPlatform() == PlatformID.Unix) //adjust for different metrics/layout under OS X/Unix notificationsControl.Width += 50; notificationsControl.Left = notificationsControl.Parent.Width - notificationsControl.Width - offset; notificationsControl.Top = notificationsControl.Parent.Height - notificationsControl.Height - offset; notificationsControl.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; }