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

No "Click" Event

2 Answers 153 Views
DesktopAlert
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 18 Dec 2014, 05:11 AM
There doesn't seem to be a global click event.  This would be useful for setting an option where the user can click anywhere on the DesktopAlert.

I tried looking for Hwnd or Handle so I could manually register a click event in this manner, but even those properties don't exist.

So, the question is this -- If there is no Click event, and there is no Handle/Hwnd, what is the code to write in order to make something happen when the user clicks anywhere on the DesktopAlert.  I considered registering the dimensions of the window and handling any clicks in that region using desktop clipping, however this is not a realistic approach as the bounds would be overlaid when other windows come into focus.

It seems like this was either a rather obvious oversight, or you have another method that isn't described in your documentation, examples and varies from standard event registration (possibly something hidden inside Properties ?? )

Thanks in advance for your reply.

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 19 Dec 2014, 04:06 PM
Hello Daniel,

Thank you for writing.

Our RadDesktopAlert control contains a DesktopAlertPopup object where you can register for the event. Please see the code snippet below:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        this.customDesktopAlert1.Popup.Click += Popup_Click;
    }
 
    private void Popup_Click(object sender, EventArgs e)
    {
        Console.WriteLine("Clicked!");
    }
}

Hope this helps. Should you have further questions do not hesitate to write back.

Regards,
Hristo
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Dan
Top achievements
Rank 1
answered on 19 Dec 2014, 04:57 PM
Thank you for your reply.  I can see the event was buried under the Popup object.

Following is the VB equivalent to your code (some minor changes with the names to default first object laced)

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  AddHandler Me.RadDesktopAlert1.Popup.Click, AddressOf RadDesktopAlert1_Click
  RadDesktopAlert1.Show()
End Sub
  
Private Sub RadDesktopAlert1_Click(sender As Object, e As EventArgs)
  RadDesktopAlert1.Hide()
End Sub
Tags
DesktopAlert
Asked by
Dan
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Dan
Top achievements
Rank 1
Share this question
or