Animated Window Effects with "Toast" popup demo - Page 3-VBForums
Page 3 of 3 FirstFirst 123
Results 81 to 110 of 110

Thread: Animated Window Effects with "Toast" popup demo

  1. #81

    Thread Starter
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  2. #82

    Thread Starter
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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,584

    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,013

    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.
    ---My Flickr photo (mostly screenshots these days!) stream. Have a look!

    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    TCP client/server connection | Retrieving the EventHandler for any Event by code.
    Check out the work in progress: Vortex - C++ 3D Game engine for windows and linux - (Development blog - Leave a comment!)

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

    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.

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

    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.
    ---My Flickr photo (mostly screenshots these days!) stream. Have a look!

    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    TCP client/server connection | Retrieving the EventHandler for any Event by code.
    Check out the work in progress: Vortex - C++ 3D Game engine for windows and linux - (Development blog - Leave a comment!)

  10. #90

    Thread Starter
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  11. #91

    Thread Starter
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    86,085

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
    81

    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
    81

    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

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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.