Page 3 of 3 FirstFirst 123
Results 81 to 115 of 115

Thread: Animated Window Effects with "Toast" popup demo

  1. #81

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote 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.

  2. #82

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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.

  3. #83
    Addicted Member
    Join Date
    Mar 2008
    Posts
    150

    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!

    Cheers,
    Scoota

  4. #84

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote 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.

  5. #85
    Addicted Member
    Join Date
    Mar 2008
    Posts
    150

    Re: Animated Window Effects with "Toast" popup demo

    Too easy, I'm already on my way. Thanks for the quick response!

  6. #86
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    1,965

    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...

  7. #87
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Animated Window Effects with "Toast" popup demo

    Those are not errors, they're warnings.
    jmcilhinney specifies that he created the project in VS2003 but there's no reason why it wouldnt work in 2008.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  8. #88
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Animated Window Effects with "Toast" popup demo

    Quote 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.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  9. #89
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Animated Window Effects with "Toast" popup demo

    Well in this case the warnings refer to shared members of the class, which "should" be accessed through the class, not an instance of the class.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  10. #90

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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.

  11. #91

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote 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.

  12. #92
    Addicted Member
    Join Date
    Jun 2006
    Location
    New Orleans, LA
    Posts
    161

    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.

  13. #93

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote 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.

  14. #94
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    Re: Animated Window Effects with "Toast" popup demo

    How can we ensure that the toast form appears within the bounds of the primary monitor in a multiple monitor setup ?

  15. #95

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote 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

  16. #96
    Lively Member
    Join Date
    Apr 2008
    Posts
    86

    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:

    VB Code:
    1. Dim myHTMLstring As String
    2.         Dim mywebclient As New Net.WebClient
    3.         myHTMLstring = mywebclient.DownloadString("www.somesite.com")
    4.         TextBox18.Text = myHTMLstring
    5.  
    6.         Dim myMatches2 As MatchCollection
    7.         Dim myRegex2 As New Regex("(?<=ON >> )[a-zA-Z0-9\. \$%?!&\#(|)_@^£’;+/:\,^=–]+")
    8.         Dim t2 As String = _TextBox18.Text
    9.         myMatches2 = myRegex2.Matches(t2)
    10.         Dim successfulMatch2 As Match
    11.         For Each successfulMatch2 In myMatches2
    12.             If ListBox4.Items.Contains(successfulMatch2.Value) Then
    13.                 TextBox19.Text = successfulMatch2.Value
    14.                 Timer6.Enabled = True
    15.                 ListBox4.Items.Remove(successfulMatch2.Value)
    16.             Else
    17.             End If
    18.  
    19.         Next

    ANd the timer

    VB Code:
    1. If Timer6.Enabled = True Then
    2.             Static sliceCount As Integer = 0
    3.             sliceCount += 1
    4.             Dim slice As New ToastForm(Me.rng.Next(2000, 4000), sliceCount & ": " & TextBox19.Text & " Is Online")
    5.             slice.Height = Me.rng.Next(100, 100)
    6.             slice.Show()
    7.         End If
    8.         Timer6.Enabled = False

    And yes how to change the width of the popup?
    Last edited by webb315; Jul 27th, 2009 at 07:06 AM.

  17. #97

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote 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.

  18. #98
    Lively Member
    Join Date
    Apr 2008
    Posts
    86

    Re: Animated Window Effects with "Toast" popup demo

    Quote Originally Posted by jmcilhinney View Post
    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.
    So can you give me any solution for this thing?

  19. #99

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote Originally Posted by webb315 View Post
    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.

  20. #100
    Lively Member
    Join Date
    Apr 2008
    Posts
    86

    Re: Animated Window Effects with "Toast" popup demo

    Quote Originally Posted by jmcilhinney View Post
    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?

  21. #101

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote Originally Posted by webb315 View Post
    No problem mate.

    Can you please tell me how to change the width of the popups?
    It's just a form so you set it's Width the way you would any form.

  22. #102
    Lively Member
    Join Date
    Apr 2008
    Posts
    86

    Re: Animated Window Effects with "Toast" popup demo

    Quote Originally Posted by jmcilhinney View Post
    It's just a form so you set it's Width the way you would any form.
    Oh the hieght was the random one.. sorry my bad..

  23. #103
    New Member
    Join Date
    Mar 2010
    Posts
    1

    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.

    Employee Scheduler

  24. #104
    New Member
    Join Date
    Jul 2011
    Posts
    1

    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

  25. #105
    New Member
    Join Date
    May 2005
    Posts
    9

    Re: Animated Window Effects with "Toast" popup demo

    This is pure awesome! Exactly what I was looking for...stacked notifications.

    This base saved me tons of time so for that, many thanks!

    Since I first grabbed this I made a bunch of changes:

    Support to pass two text messages fields

    Support to pass an image resource (icon)

    Due to Win7 I had to kill the glass as the effects were just odd, so I have a single little box then of course had to create my own close button

    Added a mouse over function that stops the timers. Mousing out starts them again.

    Added some click options to take me directly to the item in question.

    So far my users absolutely love the upgrade as do I!

  26. #106

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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.

  27. #107
    New Member
    Join Date
    May 2005
    Posts
    9

    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.

  28. #108
    New Member
    Join Date
    May 2005
    Posts
    9

    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.....).

    Enjoy and again, a million thanks to the author!
    Attached Files Attached Files

  29. #109
    Lively Member
    Join Date
    Sep 2012
    Posts
    101

    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 ?

  30. #110
    Lively Member
    Join Date
    Sep 2012
    Posts
    101

    Re: Animated Window Effects with "Toast" popup demo

    Never mind, I fixed the problem.

    Add this to Form_Load in FormAnimator.vb:


    Me.Form.TopMost = True

  31. #111
    Lively Member
    Join Date
    Mar 2010
    Posts
    71

    Re: Animated Window Effects with "Toast" popup demo

    After almost 10 years later, I could still say that this is such a great contribution.

    However, I'm facing some issues. I can only generate something like 12-16 toasts, after that Toasts do not show up at all.

    They are set to TopMost.

    Any ideas?

    Thanks!

  32. #112
    Member
    Join Date
    May 2015
    Posts
    58

    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?

  33. #113
    New Member
    Join Date
    Oct 2016
    Posts
    4

    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()

    MsgBox("test")
    End Sub

    good job btw

    regards,

  34. #114

    Thread Starter
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Animated Window Effects with "Toast" popup demo

    Quote Originally Posted by eliaspizarro View Post
    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.

  35. #115
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Animated Window Effects with "Toast" popup demo

    Quote Originally Posted by eliaspizarro View Post
    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.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width