Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Thu Sep 22, 2005 4:32 am Post subject: HOWTO : Determine when the text or link of a shell popup notification window is clicked |
|
|
The ShellPopupNotification component does not have a direct event which enables the developer to determine when the text or link of a shell popup notification window is clicked. Instead, the MouseUp event must be used to achieve this as follows :
[C#]
' MouseUp event handler
private void shellPopupNotification1_MouseUp(object sender, LogicNP.ShellObjects.ShellPopupMouseEventArgs e)
{
' Call the HitTest method of ShellPopup
if(e.Popup.HitTest(e.X,e.Y)==ShellPopupAreas.Text)
MessageBox.Show("Text clicked");
}
[VB.Net]
' MouseUp event handler
Private Sub ShellPopupNotification1_MouseUp(ByVal sender As Object, ByVal e As LogicNP.ShellObjects.ShellPopupMouseEventArgs) Handles ShellPopupNotification1.MouseUp
' Call the HitTest method of ShellPopup
If e.Popup.HitTest(e.X, e.Y) = LogicNP.ShellObjects.ShellPopupAreas.Text Then
MessageBox.Show("Text Clicked")
End If
End Sub
Similarly, to determine whether the link was clicked, simply use Link enumeration member instead of Text as follows :
[C#]
' Call the HitTest method of ShellPopup
if(e.Popup.HitTest(e.X,e.Y)==ShellPopupAreas.Link)
MessageBox.Show("Text clicked");
[VB.Net]
' Call the HitTest method of ShellPopup
If e.Popup.HitTest(e.X, e.Y) = LogicNP.ShellObjects.ShellPopupAreas.Link Then
MessageBox.Show("Text Clicked")
End If
This technique can also be used to determine whether the background image, logo image, background or the Office2003 gripper was clicked. |
|