No "Click" Event

3 posts, 1 answers
  1. Dan
    Dan avatar
    4 posts
    Member since:
    Sep 2012

    Posted 17 Dec 2014 Link to this post

    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. Answer
    Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 19 Dec 2014 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dan
    Dan avatar
    4 posts
    Member since:
    Sep 2012

    Posted 19 Dec 2014 in reply to Hristo Link to this post

    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
Back to Top