Re: Animated Window Effects with "Toast" popup demo
Originally Posted by Xancholy
Best practice. My only request would be to please include a sample image of toast in action... thanks
The whole point of this is the animation. A screen shot of an animation is just a little useless. Also, there's a fully working demo project attached for download. You just need to download, unzip, open and run. That's less than a minute's work to see a toast demo in all it's glory. If you'd like to take a screen of it you're welcome to, but I don't see it impressing too many people.
Re: Animated Window Effects with "Toast" popup demo
I just ran this on Vista for the first time and the results were not especially inspiring. I guess it has something to do with Aero and the drop shadows around windows. Maybe there's a Vista replacement for the AnimateWindow API, or maybe the Slide animation just doesn't work properly on Vista. I must say, I can't recall any of my installed apps using that effect. The Blend effect works better but the drop shadow does disappear all of a sudden, making things less smooth than they ideally would be. When I have time I may investigate this further.
EDIT: Just did a quick search and saw several people asking about issues with AnimateWindow under Vista but no solutions. As such I can only recommend that you only use the Blend effect under Vista as the others produce unsatisfactory results.
Last edited by jmcilhinney; Jun 6th, 2008 at 10:05 PM.
Re: Animated Window Effects with "Toast" popup demo
Hey JM,
This is great, but it's not suiting my requirements exactly. I'm wondering if there's "easy" way to animate the window back to a particular point instead of just animating it as it's closed or opened?
Failing that I can set up my own functions to move the window with a timer and so on, but this is flawless so it's worth asking the silly question!
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by scootabug
Hey JM,
This is great, but it's not suiting my requirements exactly. I'm wondering if there's "easy" way to animate the window back to a particular point instead of just animating it as it's closed or opened?
Failing that I can set up my own functions to move the window with a timer and so on, but this is flawless so it's worth asking the silly question!
Cheers,
Scoota
This API is only for showing and hiding the window. You'll have to do as you suggested and use a Timer to move the form around while it's visible.
Re: Animated Window Effects with "Toast" popup demo
Are these classes compatible with VS2008? When I loaded the demo project there were a lot of errors to correct, mostly replacing the 'Me.' with the form names. But it did run...
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by nbrege
Are these classes compatible with VS2008? When I loaded the demo project there were a lot of errors to correct, mostly replacing the 'Me.' with the form names. But it did run...
Why would you replace the 'Me' keyword with the form name? 'Me' already refers to the current class (the form in this case) that it needs to.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: Animated Window Effects with "Toast" popup demo
Those warnings were due to referring to constants via the current instance. When I wrote that code I didn't know that constants are inherently Shared and 2003 didn't flag it. I will be rewriting this code sometime soon. It will still work as is though.
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by jmcilhinney
I will be rewriting this code sometime soon.
I've removed the original attachments and added new ones. The solution attached to the first post was rewritten in VB 2005 with a few changes. The attached class file is from that solution, if you just want animation without the toast feature.
Re: Animated Window Effects with "Toast" popup demo
This works great and almost perfectly for what I need to do.
Scenario:
I put a 15 second countdown timer on the initial form that activates the toast window. Works beautifully!
Same setup but now when I run the project I move focus to notepad and typing continuously through the timer and through the toast window, meaning it did not steal focus. Again, beautiful!
Same setup but now I minimize the application as soon as I run it, and the toast form doesn't show up. I did set the toast form to always be on top to solve one other problem, but I doubt that affects this.
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by Minolwen
This works great and almost perfectly for what I need to do.
Scenario:
I put a 15 second countdown timer on the initial form that activates the toast window. Works beautifully!
Same setup but now when I run the project I move focus to notepad and typing continuously through the timer and through the toast window, meaning it did not steal focus. Again, beautiful!
Same setup but now I minimize the application as soon as I run it, and the toast form doesn't show up. I did set the toast form to always be on top to solve one other problem, but I doubt that affects this.
That's a good point. All my original tests were conducted with the demo app being the active app. I tried using a Timer to spawn the Toast form and it did often get displayed behind another window. I just set the form's TopMost property to True and that fixed it.
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by Xancholy
How can we ensure that the toast form appears within the bounds of the primary monitor in a multiple monitor setup ?
It already does that for itself, although you'll have to make sure that the StartPosition is set to Manual. I thought it was originally but I just downloaded the project and it's not, so either I forgot or that's a VS glitch.
Code:
Private Sub ToastForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Display the form just above the system tray.
Me.Location = New Point(Screen.PrimaryScreen.WorkingArea.Width - Me.Width - 5, _
Screen.PrimaryScreen.WorkingArea.Height - Me.Height - 5)
'Move each open form upwards to make room for this one.
For Each openForm As ToastForm In ToastForm.openForms
openForm.Top -= Me.Height + 5
Next
'Add this form from the open form list.
ToastForm.openForms.Add(Me)
'Start counting down the form's liftime.
Me.lifeTimer.Start()
End Sub
Re: Animated Window Effects with "Toast" popup demo
First thanks for the awesome code.
Can you please tell me why my code is not working for loop? i have a list box. in which there are many items. and i use regular expression to match those values. and if there are match then the toast should pop up.. The thing is it does pops up but only for last item / match... even i used it in timer.. i want a popup for each match.. here is my code:
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by webb315
Can you please tell me why my code is not working for loop?
If your UI thread is busy executing the loop then it can't execute the second code block. Each thread can only do one thing at a time, so the Timer's Tick event won't be handled until the loop is finished.
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by jmcilhinney
If your UI thread is busy executing the loop then it can't execute the second code block. Each thread can only do one thing at a time, so the Timer's Tick event won't be handled until the loop is finished.
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by webb315
So can you give me any solution for this thing?
I don't really understand why you're using a Timer at all but, regardless, your issue really has nothing to do with the topic of this thread. I suggest that you start a new thread in the VB.NET forum. Explain what you're trying to achieve and those with the time, knowledge and inclination can help you find the best way to achieve it.
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by jmcilhinney
I don't really understand why you're using a Timer at all but, regardless, your issue really has nothing to do with the topic of this thread. I suggest that you start a new thread in the VB.NET forum. Explain what you're trying to achieve and those with the time, knowledge and inclination can help you find the best way to achieve it.
No problem mate.
Can you please tell me how to change the width of the popups?
Re: Animated Window Effects with "Toast" popup demo
Thanks for this. This is a great way to notify people. I used it to show that there is a new release on my codeplex project so users can get the latest and greatest.
Re: Animated Window Effects with "Toast" popup demo
hi, jmcilhinney. you know I try to log in my account that I can't open long ago.
because I just start again with vb.net. and I want to say that you are make me smile. you are imagine
Thank for your smooth slide code
Re: Animated Window Effects with "Toast" popup demo
@JEmlay, glad to know that it's been put to good use. If your code is proprietary then I understand but, if possible, it might be nice to post your extensions here to help others.
Re: Animated Window Effects with "Toast" popup demo
It's proprietary but I'll update the test I created from your project once everything is done. That way myself and my team will always have it around to put in new projects.
Re: Animated Window Effects with "Toast" popup demo
As promised here's my changes. I removed the passing of the icon and opted to instead simply change the form background globally based on my needs. Those different small backgrounds include whatever image changes I need. This was easier since a couple notifications required a couple images.
In this change up:
Support to pass two text message fields.
Killed glass and opted for simple square-ish form due to Win7 (possibly Vista as well) goofing it all up. I also hard coded fade in and out as slide and roll were also goofed up by Win7. There might be some extra code to clean up that are roll and slide specific.
Added a mouse over function that stops the timers. Mousing out starts them again.
Added a click option to handle the notification item in question. Simply click the notification.
Added exit button for no other reason then to remain consistant with other pop up notifications out there (Outlook, Trillian.....).
Re: Animated Window Effects with "Toast" popup demo
I am having problems with the popup. I use JEmlays' version. But my problem has nothing to do with the feature he added, so I guess this is a problem concerning the original version as well.
Okay so when the form pops up in the bottom right corner, then let's say I am browing the web. I have to minimize the webbrowser, in order to see the form. Because the form is like behind the webbrowser, or whatever program I am running. Is it possible to make it stay on the top regardless what I am doing ?
Re: Animated Window Effects with "Toast" popup demo
Fantastic example! Really taught me a lot! I do have one question though. Is there a way to make it so that each instance of the ToastForm doesn't create an entry in the task bar?
EDIT: NEVERMIND! I found a property that I hadn't seen before. " Form.ShowInTaskbar " LOL How easy was that?
Re: Animated Window Effects with "Toast" popup demo
inputbox or msgbox disapear sometimes. for example add this to the code
Sub errTest()
Dim Notification As New frmNotification(5000, "This is a test message " & variable, "This is a second text message to pass")
Notification.Show()
variable += 1
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
errTest()
errTest()
errTest()
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by eliaspizarro
inputbox or msgbox disapear sometimes. for example add this to the code
Sub errTest()
Dim Notification As New frmNotification(5000, "This is a test message " & variable, "This is a second text message to pass")
Notification.Show()
variable += 1
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
errTest()
errTest()
errTest()
MsgBox("test")
End Sub
good job btw
regards,
Maybe if you could provide a clear explanation of what you expect to see and what you actually do see, we'd know what to look out for if we decide to test your code.
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by eliaspizarro
inputbox or msgbox disapear sometimes. for example add this to the code
Sub errTest()
Dim Notification As New frmNotification(5000, "This is a test message " & variable, "This is a second text message to pass")
Notification.Show()
variable += 1
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
errTest()
errTest()
errTest()
MsgBox("test")
End Sub
good job btw
regards,
What are you even talking about?
Currently using VS 2015 Enterprise on Win10 Enterprise x64.