Desktop Alert with Dual Monitors

5 posts, 1 answers
  1. Martin
    Martin avatar
    35 posts
    Member since:
    Jun 2014

    Posted 10 Oct Link to this post

    Hi,

    I'm using the radDeskTopAlert for WinForms and it's a very nice control.

    However, I'm finding that if I move the client application from monitor 1 to monitor 2 the desktop alerts still popup in the same place on monitor 1.

    If I restart the application on Monitor 2 the alerts still appear on Monitor 1.

    Is there a way to use X,Y co-ords to get around this problem?

    Many Thanks,

    Martin.

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 11 Oct Link to this post

    Hi Martin,

    Thank you for writing.

    You can use the static DesktopAlertManager class to specify on which screen the alerts will display:
    DesktopAlertManager.Instance.SetActiveScreen(Screen.AllScreens[0]);

    More information is available here: DesktopAlertManager.

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Martin
    Martin avatar
    35 posts
    Member since:
    Jun 2014

    Posted 11 Oct in reply to Dimitar Link to this post

    Thanks Dimitar,

    So simple yet so effective!

  5. Shakti SIngh Dulawat
    Shakti SIngh Dulawat avatar
    89 posts
    Member since:
    Oct 2009

    Posted 02 Nov in reply to Martin Link to this post

    Hello Martin,
    Can you please share your code, Since I do not have duel monitor at my side but my customer have so I want to confirm code before check in any thing.

    Are you  using 
     DesktopAlertManager.Instance.SetActiveScreen(Screen.AllScreens[0]);
    or

    DesktopAlertManager.Instance.ActiveScreen(DesktopAlertManager.Instance.ActiveScreen)


     RadDesktopAlert popAlert = new RadDesktopAlert();
                popAlert.Popup.LocationChanged += Popup_LocationChanged;
                //STARTING FORMATTING 
                popAlert.FixedSize = new Size(350, 110);
                popAlert.ContentImage = WiseOption.Properties.Resources.IconTick48;
                popAlert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.Font = new Font(popAlert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.Font.FontFamily, (float)15, FontStyle.Bold);
                popAlert.Popup.AlertElement.ContentElement.Font = new Font(popAlert.Popup.AlertElement.ContentElement.Font.FontFamily, (float)10, FontStyle.Bold); //Earlier Font is 9.25
                popAlert.Popup.AlertElement.CaptionElement.CaptionGrip.GradientStyle = GradientStyles.Solid;
                popAlert.Popup.AlertElement.GradientStyle = GradientStyles.Solid;
                // END FORMATTING 
                popAlert.CaptionText = "My Message";
                popAlert.ContentText = displayMessage;
                popAlert.ScreenPosition = AlertScreenPosition.TopRight;
                popAlert.ShowCloseButton = true;
                popAlert.ShowOptionsButton = false;
                popAlert.ShowPinButton = false;
                popAlert.PopupAnimation = true;
                popAlert.PopupAnimationDirection = RadDirection.Down;
                popAlert.PopupAnimationEasing = RadEasingType.Default;
                popAlert.PopupAnimationFrames = 50;
                popAlert.AutoClose = true;
                popAlert.AutoCloseDelay = 3;
                popAlert.FadeAnimationSpeed = 50;
                popAlert.Show();

  6. Shakti SIngh Dulawat
    Shakti SIngh Dulawat avatar
    89 posts
    Member since:
    Oct 2009

    Posted 15 Nov Link to this post

    I figure out best way and solutions is 

     Screen screen = Screen.FromControl(thisForm); // This form is your current form 
                DesktopAlertManager.Instance.SetActiveScreen(screen);

Back to Top
UI for WinForms is Visual Studio 2017 Ready