Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi
This program will show notification balloon when user log in to their computer. How to make use of the notification balloon click? I mean user dont have to click icon in system tray instead but able to click the notification balloon to proceed to another form. Please advise me.

This is my codes:-
VB
 If (stat = 1) Then
   'frmnotify2.Show("You need to fill up the Personal Details first.")
AddHandler NotifyIcon1.BalloonTipClicked, AddressOf NotifyIcon1_BalloonTipClicked
   NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info ' Info on the balloon. you can change it to warning or error type as welll
   NotifyIcon1.BalloonTipText = " Please complete the Personal Details section then double click then click this notification to proceed"
   NotifyIcon1.BalloonTipTitle = " U-Surf System Notification"
   NotifyIcon1.ShowBalloonTip(5)
 end if

I have used event handler but it seems not working.
Please if anyone could help me on this.

VB
Private Sub NotifyIcon1_BalloonTipClicked(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.BalloonTipClicked
  frmQuestionnaire.Show()
 End Sub



Thank you
Posted
Updated 15-Feb-11 7:33am
v2
Comments
DaveAuld 15-Feb-11 13:33pm    
Edit: Formatting code blocks
zafi24 15-Feb-11 13:37pm    
tq. This is my first time using this forum. Please advise if I am doing anything wrong.
DaveAuld 15-Feb-11 14:07pm    
1) Read the FAQ's you will see how to use the formatting correctly for different languages.
2) if you want to reply to a specific comment, hover over that comment and click the reply comment instead of using an Add Comment, this way the user you are replying to will get an email notification of the comment being posted so they can review and respond if required.
3) If you expect to get into a lengthy debate about a subject Don't use Q&A's find a relevant forum and post there instead.
:)

The timeout may be too small. Change that from 5 milliseconds to at least 5000 (5 seconds).
 
Share this answer
 
Comments
zafi24 15-Feb-11 13:42pm    
HiAre you saying change :-

NotifyIcon1.ShowBalloonTip(5)--> 5000?
I did but nothing happen upon clicking the notification balloon. Or I did something wrong?
Nish Nishant 15-Feb-11 13:44pm    
There's nothing in the code you posted that shows what's wrong. I quickly put together a simple project, added a notifyicon control, and the event fires fine (and I get the event handler to execute too).
Nish Nishant 15-Feb-11 13:45pm    
Put a breakpoint in the event handler and see if it hits. Perhaps your form show is failing for some reason.
zafi24 15-Feb-11 13:52pm    
Hi Nishant,

I have set breakpoint, It hit the ddHandler NotifyIcon1.BalloonTipClicked, AddressOf NotifyIcon1_BalloonTipClicked until NotifyIcon1.ShowBalloonTip(5) .. Then notification balloon pop up. Even I click the notification balloon, nothing happen.
Based on your comments, can you give me some example?
Nish Nishant 15-Feb-11 13:59pm    
I meant can you put a breakpoint inside the handler? On the line where frmQuestionnaire.Show is called.
Just an FYI, but it appears that you've double hooked the BalloonTipClicked event. If you added NotifyIcon1 to your form through the designer and haven't reset it anywhere, then by writing Handles NotifyIcon1.BalloonTipClicked in
VB
Private Sub NotifyIcon1_BalloonTipClicked(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.BalloonTipClicked


you've already added the handler, and you don't need to write AddHandler .... Do one or the other, but not both.

And, I would say the same thing as Nishant...put a breakpoint at frmQuestionnaire.Show and see if it ever hits the breakpoint.

Also as an FYI, but your tooltip text doesn't make any sense. Why do you tell them to complete a section, double-click (where to double-click you didn't say) and then click the notification? Where does it ever say they should click the balloon?
 
Share this answer
 
Hi William,

I try to remove addhandler but error occurs

For the text message it is not the one that I currently used. The new one will only saying click the balloon. Tq for your advise anyway

I know this codes suppose to work as I try it in other new form But it's not working with mine. I really hope you guys can help me upon this matter. When I set the breakpoint, yes it go into the form(Frmquestionnaire).

I detect this:_

It unable to show/pop up because i use this Me.MdiParent = frmmain in my Frmquestionnaire.
me = Frmquestionnaire
If I remove it, then I can show the form however, The form will look weired without the borders.

Private Sub frmQuestionnaire_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
     Me.MdiParent = frmmain

    ListView1.HideSelection = False ' ADD 14/02/11
    ListView1.Items.Clear() ' ADD 11/02/11

    Me.UpdateListView()


End Sub


Is there any way to solve this?

Please advise me

Thank you
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900