This is a migrated thread and some comments may be shown as answers.

How to open a new page on click of desktopalert

4 Answers 230 Views
DesktopAlert
This is a migrated thread and some comments may be shown as answers.
VIJESH
Top achievements
Rank 1
VIJESH asked on 09 Dec 2012, 10:55 AM
Hi 

I am using desktopalert control in my windows form. I want to know how I can redirect to a new page on clicking the desktopalert (by clicking anywhere on the desktopalert or on the captiontex or on the caption image).

Also I want to know how can I make this application which would wake up every x minutes and check our database for some condition and display the desktopalert.

Thanks

4 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 13 Dec 2012, 08:54 AM
Hello Vijesh,

You can do this by using the click event of RadDesktopAlert popup. Consider the following sample:

RadDesktopAlert alert = new RadDesktopAlert();
alert.CaptionText = "Hello world";
alert.ContentText = "I am a simple desktop alert message.";
alert.Popup.Click += new EventHandler(Popup_Click);
alert.Show();
 
void Popup_Click(object sender, EventArgs e)
{
    MessageBox.Show("Alert clicked!");
}

Find further details about RadDesktopAlert in our online documentation.

You can wake up your application by using a timer. Consider this MSDN forum thread for an example.

If you need further assistance, I will be glad to help.

Regards, Jack
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
VIJESH
Top achievements
Rank 1
answered on 13 Dec 2012, 10:39 AM
Hi Jack,

Thanks for your reply.
The code which you sent is working fine for me. But on click of close button or pin button, the message box is displaying.
0
Jack
Telerik team
answered on 14 Dec 2012, 01:34 PM
Hello Vijesh,

You can avoid this by checking the element that is currently located under the mouse. Do this by calling the GetElementAtPoint method. Here is a sample:
void Popup_Click(object sender, EventArgs e)
{
    DesktopAlertPopup popup = (DesktopAlertPopup)sender;
    Point pt = popup.PointToClient(Control.MousePosition);
    RadButtonElement button = popup.ElementTree.GetElementAtPoint(pt) as RadButtonElement;
    if (button != null)
    {
        return;
    }
    MessageBox.Show("Hello world!");
}

Regards,
Jack
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
VIJESH
Top achievements
Rank 1
answered on 14 Dec 2012, 03:51 PM
Hi Jack,

Your code works fine for me. Thank you so much.

Regards,
VIJESH
Tags
DesktopAlert
Asked by
VIJESH
Top achievements
Rank 1
Answers by
Jack
Telerik team
VIJESH
Top achievements
Rank 1
Share this question
or