Show RadDesktopAlert on active screen

2 Answers 109 Views
DesktopAlert
Zygmunt
Top achievements
Rank 1
Iron
Iron
Iron
Zygmunt asked on 27 Mar 2023, 08:25 AM

Hi,

How can I show RadDesktopAlert always on active screen?

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 27 Mar 2023, 11:15 AM

Hello, Zygmunt,

Please have a look at the following help article demonstrating how to setup and show a RadDesktopAlert:

https://docs.telerik.com/devtools/winforms/controls/desktopalert/gettingstarted 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Zygmunt
Top achievements
Rank 1
Iron
Iron
Iron
commented on 27 Mar 2023, 01:34 PM

I use DesktopAlertManager like presented below but alerts always shown on primary screen.


DesktopAlertManager.Instance.SetActiveScreen(DesktopAlertManager.Instance.ActiveScreen);

radDesktopAlert.FixedSize = new System.Drawing.Size(330, 70);
radDesktopAlert.Popup.LoadElementTree();
RadDesktopAlertElement alertElement = ((DesktopAlertPopup)radDesktopAlert.Popup).RootElement.Children[0] as RadDesktopAlertElement;
alertElement.ContentElement.Measure(new SizeF(radDesktopAlert.FixedSize.Width, float.PositiveInfinity));
radDesktopAlert.FixedSize = new Size(radDesktopAlert.FixedSize.Width, (int)alertElement.ContentElement.DesiredSize.Height + 50);

radDesktopAlert.Show();

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Mar 2023, 08:34 AM

Hi, Zygmunt,

The DesktopAlertManager.Instance.ActiveScreen property is initialized with the main monitor (Screen.PrimaryScreen) specified in the Display settings of the operating system. 

It is possible to show the alert considering on which monitor the main form is currently placed. The following code snippet demonstrates a sample approach how to do it. Thus, wherever you move the main form from which the alert is shown, this will be the monitor for showing the alert: 

        private void timer1_Tick(object sender, EventArgs e)
        {
            DesktopAlertManager.Instance.SetActiveScreen(Screen.FromPoint(this.Location));
            this.radDesktopAlert1.CaptionText = "New E-mail Notification";
            this.radDesktopAlert1.ContentText = "Hello Jack, I am writing to inform you " +
                                                "that the planning meeting scheduled for Wednesday has been postponed and" +
                                                "it will eventually be rescheduled, possibly for the next Tuesday";

            radDesktopAlert1.Show();
        }

Please give it a try and see how it works on your end. Would this approach be suitable for your scenario? If not, it would be greatly appreciated if you can share more details about the exact goal that you are trying to achieve. Thus, we would be able to think about an appropriate solution.

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Ishank
Top achievements
Rank 1
Iron
commented on 29 Jul 2024, 09:32 AM

Hi, 

I've a scenario, where I want a dialog to appear on top of RadDesktopAlert. 

I've set the alert to my main screen and if any subsequent popup/dialog gets opened, it is hidden by the RadDesktopAlert and is not clearly visible. So I want these popups to appear on top of RadDesktopAlert. 

How can I achieve this ?

Dinko | Tech Support Engineer
Telerik team
commented on 01 Aug 2024, 08:24 AM

The RadDesktopAlert is designed in a way to appear on top. I am not sure what kind of popups are shown in your application but what you can try is to use RadForm to design it to look like a popup and set its TopMost property to true. This way the newly shown form will appear on top of the RadDesktopAlert popup. Another approach, if possible, is to change the location of the RadDesktopAlert so that it does not overlap with any other popup.
Ishank
Top achievements
Rank 1
Iron
commented on 01 Aug 2024, 09:31 AM

Thanks Dinko.
Tags
DesktopAlert
Asked by
Zygmunt
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or