-
Oct 3rd, 2005, 08:40 PM
#41
Re: Animated Window Effects with "Toast" popup demo
I'm using XP SP2. Perhaps that's an issue, but I don't see why. I doubt the AnimateWindow API was changed at all with the update, but I suppose there might be some reason. The question is, why haven't you installed SP2 yet? Slacker!
-
Oct 3rd, 2005, 10:00 PM
#42
Re: Animated Window Effects with "Toast" popup demo
Aside from you have SP2, do you have any clues why it doesn't run on some machines? How about providing us an installer for it?
-
Oct 3rd, 2005, 10:13 PM
#43
Re: Animated Window Effects with "Toast" popup demo
I have no clue what the issue might be and I can't see how an installer could make a difference. Have you tried compiling a release build and running that? Do you get the same exception if you do? The only other thing I can suggest is to create your own project from scratch. You could then generate new class files in the IDE and either write the code yourself or copy and paste it from the old files. I don't really see why this would make a difference, but then I don't see why there's an issue in the first place.
-
Oct 3rd, 2005, 11:05 PM
#44
Re: Animated Window Effects with "Toast" popup demo
Ok, I'll try your suggestions later and will return to give a feedback...
-
Oct 4th, 2005, 08:44 AM
#45
Frenzied Member
Re: Animated Window Effects with "Toast" popup demo
-
Oct 6th, 2005, 07:58 PM
#46
Re: Animated Window Effects with "Toast" popup demo
It appears that the issues that some have been having are due to a bug in the Framework that was fixed in SP1, so apply SP1 for the .NET Framework 1.1 and all should be well.
-
Feb 1st, 2006, 10:00 AM
#47
New Member
Re: Animated Window Effects with "Toast" popup demo
Hi all,
anyone knows whether this is also working with .net 2.0?
-
Feb 2nd, 2006, 01:59 AM
#48
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by K321
Hi all,
anyone knows whether this is also working with .net 2.0?
The classes and project (I think that's what's in the ZIP file but it's been a while) that I've provided were created in VS.NET 2003. There's nothng in there that wouldn't work in .NET 2.0 though. You should just be able to open the project in VS 2005 and have it converted. I think you'll find that you could also add those class files to a project as Existing Items exactly as they are.
-
Feb 2nd, 2006, 02:51 AM
#49
New Member
Re: Animated Window Effects with "Toast" popup demo
Thanks for the fast response. Question was more about the .net 2.0 instead of VS 2005. I still use VS 2003 and .net 1.1 but I wonder whether users with .net 2.0 might still be able to get my program running then. I've read about the bug with .net 1.1 which was fixed in SP1 so maybe someone already uses this on .net 2.0 before I add this to my program?
-
Feb 2nd, 2006, 03:05 AM
#50
Re: Animated Window Effects with "Toast" popup demo
.NET 2.0 is not just an update to the Framework that everyone should use. Version 2.0 of the Framework is only for applications written with VS 2005. VS.NET 2003 is only capable of targeting versions 1.0 and 1.1. Anyone using an application that you write using VS.NET 2003 should be installing version 1.1 of the Framework, even if they have version 2.0 installed already. Most apps written for version 1.1 will still run if only version 2.0 is present but there is no guarantee. Again, version 2.0 is not just an update for users of version 1.1. It is intended for users of applications written with VS 2005.
-
Feb 2nd, 2006, 03:30 AM
#51
New Member
Re: Animated Window Effects with "Toast" popup demo
Yeah, I guess most users with 2.0 will also still have 1.1, you're right. As far as I remember .net 1.1 is automatically installed even if you only install VS 2005 so I could assume that everyone has .net 1.1 currently, right? At least before Vista comes, don't know how it is handled there....
Thanks!!
-
Feb 2nd, 2006, 03:58 AM
#52
Re: Animated Window Effects with "Toast" popup demo
VS.NET 2002 is built on and installs version 1.0 of the Framework. VS.NET 2003 is built on and installs version 1.1 of the Framework. VS 2005 is built on and installs version 2.0 of the Framework. You should supply a link, at the very least, that your users can use to download the correct version for the app you are supplying. If you have apps on your machine built with all three version of VS.NET then you should have all three versions of the Framework installed too. Only Windows Server 2003 comes with a the Framework as standard. Everyone else has to install it themselves. Vista will come with version 2.0 as standard. Previous versions would still need to be installed for apps written with earlier versions of VS.NET. Those apps will use version 2.0 if that's all that's available and most will work without issue, but there is no guarantee.
-
May 29th, 2007, 03:17 AM
#53
Re: Animated Window Effects with "Toast" popup demo
Sir this is in 2003 so what about the 2005.
Thanks
-
May 29th, 2007, 04:51 AM
#54
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by shakti5385
Sir this is in 2003 so what about the 2005.
Thanks
The FormAnimator class should work as is. The ToastForm is just a form, so you can create your own in VB 2005 and then add the same custom code as I did in before.
-
May 29th, 2007, 06:19 AM
#55
Re: Animated Window Effects with "Toast" popup demo
I think there is no FormAnimator class as you suggest.
FormAnimator class
-
May 29th, 2007, 06:03 PM
#56
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by shakti5385
The FormAnimator class is one that I wrote myself and it's attached to the first post this thread. It was the whole point of this thread. Hit yourself over the head with something heavy and say "D'oh", then blush furiously.
-
May 29th, 2007, 11:47 PM
#57
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by jmcilhinney
The FormAnimator class is one that I wrote myself and it's attached to the first post this thread. It was the whole point of this thread. Hit yourself over the head with something heavy and say "D'oh", then blush furiously.
-
Jun 13th, 2007, 04:27 AM
#58
Re: Animated Window Effects with "Toast" popup demo
Dear John,
How can change the form show style as disolving ?
Dana
-
Jun 13th, 2007, 05:06 AM
#59
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by danasegarane
Dear John,
How can change the form show style as disolving ?
Dana
No idea.
-
Jun 13th, 2007, 07:05 AM
#60
Re: Animated Window Effects with "Toast" popup demo
Dear Jhon,
I think you have misunderstand.During form unload you have given one method as disolve.Is there any method aval to show the form during load event
thnks
Dana
Please mark you thread resolved using the Thread Tools as shown
-
Jun 14th, 2007, 12:24 AM
#61
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by danasegarane
Dear Jhon,
I think you have misunderstand.During form unload you have given one method as disolve.Is there any method aval to show the form during load event
thnks
Dana
I don't know what you mean. There are four effects supported by AnimateWindow: Roll, Centre, Slide and Blend. All four are supported on both loading and closing.
-
Jun 14th, 2007, 03:09 AM
#62
Re: Animated Window Effects with "Toast" popup demo
Dear Jhon,
I want to show the form like a blend. Is this posible ?
Last edited by danasegarane; Jun 16th, 2007 at 03:31 AM.
-
Jun 14th, 2007, 04:04 AM
#63
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by danasegarane
Dear Joho,
I want to show the form like a blend. Is this posible ?
Yes it is, and the very first paragraph of the very first post of this thread explains how.
-
Jun 14th, 2007, 05:18 AM
#64
Re: Animated Window Effects with "Toast" popup demo
I trying this method.
vb Code:
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.m_activeDB = New FormAnimator(Me, _
FormAnimator.AnimationMethod.Blend, _
FormAnimator.AnimationDirection.Up, _
1000)
Dim mnumanger As New SystemMenuManager(Me, False, SystemMenuManager.MenuItemState.Disabled)
End Sub
Private Sub Form2_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
'Close the form by sliding down.
Me.m_activeDB.Direction = FormAnimator.AnimationMethod.Blend
End Sub
This Gives a nice effect during the closing of the Form.But it not showing the
efffect during form load event.
Dana
Last edited by danasegarane; Jun 14th, 2007 at 05:21 AM.
Reason: VBCode Tag Added
Please mark you thread resolved using the Thread Tools as shown
-
Jun 14th, 2007, 07:16 PM
#65
Re: Animated Window Effects with "Toast" popup demo
1. I just tested the following code:
vb.net Code:
Public Class Form2
Private m_activeDB As FormAnimator
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.m_activeDB = New FormAnimator(Me, _
FormAnimator.AnimationMethod.Blend, _
FormAnimator.AnimationDirection.Up, _
1000)
End Sub
End Class
and it worked fine for me.
2. You don't blend a form in any direction so there's no point using the FormAnimator constructor that takes a direction.
3. In your Closing event handler you're assigning an animation method to a property that is supposed to take an animation direction. Again, blending isn't done in any direction so setting one is pointless, but if you were going to set one you should at least use a value of the appropriate type. If that code doesn't throw a compilation error then you must have Option Strict turned Off. I suggest that you rectify that immediately.
-
Jun 15th, 2007, 06:20 AM
#66
Member
Re: Animated Window Effects with "Toast" popup demo
nice work
-
Nov 14th, 2007, 08:52 PM
#67
Hyperactive Member
Re: Animated Window Effects with "Toast" popup demo
-
Nov 14th, 2007, 09:41 PM
#68
Re: Animated Window Effects with "Toast" popup demo
[Basking in the glow of praise]Thank you, thank you.[/Basking in the glow of praise]
Last edited by jmcilhinney; Oct 17th, 2019 at 08:46 PM.
-
Nov 30th, 2007, 07:18 AM
#69
Addicted Member
Re: Animated Window Effects with "Toast" popup demo
Great work on the toastform class jmc! (1 more reason to bask in the glory of praise! )
But theres a little problem that i have encountered using this toastform.
I am using VBExpress 2005 (.NET 2.0).
All seems to be well till I try to declare and Show the form from a new thread. When I do that, the form is visible till the duration of the animation, but after that the form simply disappears. I even tried to debug it while setting a breakpoint at Me.Close() and lifeTimer.Tick, but the breakpoints are never hit! . I have simply no idea where the form goes after it disappears. Two things I know for sure: The form never closes itself,and the lifeTimer.Tick event doesn't fire.
Some threading issue perhaps? or the Timer?
It seems that the Windows.Forms.Timer sticks to the UI thread only. So, the Timer.Tick event may not fire at all.
But on the other hand, the System.Timers.Timer is said to raise the Elapsed event on new threads from the ThreadPool every time it is raised. So, it throws an InvalidOperationException: "Cross-thread operation not valid: Control 'PopupNotifierForm' accessed from a thread other than the thread it was created on.", citing the (cross-thread) call to "Me.Close()" as invalid. Delegation didn't help either. That throws a NullReferenceException: "Object reference not set to an instance of an object".
This is the code I am trying to delegate the Me.Close method.
VB Code:
Public Delegate Sub FormCloseDelegate()
Public Class ToastForm
'...
'...
Public Sub FormClose()
If Me.InvokeRequired Then
Me.Invoke(New FormCloseDelegate(AddressOf FormClose)) 'Throws NullReferenceException: "Object reference not set to an instance of an object"
Else
Me.Close()
End If
End Sub
End Class
Even Threading.Timer using the TimerCallback throws the same exception.
VB Code:
Private LifeTimerCallback as New TimerCallback(AddressOf lifeTimer_CallbackMethod)
Private Sub ToastForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'...
Me.lifetimer = New Threading.Timer(Me.lifeTimerCallback, Nothing, lifetime, 0)
End Sub
'...
Private Sub lifeTimer_CallbackMethod(obj as Object)
Me.FormClose() 'If I use Me.Close instead, it throws a InvalidOperationException: "Cross-thread operation not valid: Control 'PopupNotifierForm' accessed from a thread other than the thread it was created on."
End Sub
Am I doing anything wrong or is it just the way these things work? Is there no way to make the form work normally if instantiated and called from new threads?
Any help will be truly appreciated.
And jmc, THANX ONCE AGAIN FOR THIS BEAUTIFUL SOLUTION!!!
Anyone who has never made a mistake has never tried anything new. - Einstein
Peace!
-
Mar 18th, 2008, 12:05 PM
#70
Junior Member
Re: Animated Window Effects with "Toast" popup demo
Thanks for your code Jim. It's really great! When using the FormAnimator class everything works great. The only problem is that when my date time picker is displayed it's viewed as sunk down in the form and it lost it's blue border like my combo box has. Do you have any idea on how to fix that problem? is it a property on my date time picker? I tried to look for the border property on the date time picker and realized that wasn't there. Any help will be appreciated.
-
Mar 18th, 2008, 05:40 PM
#71
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by Tim Hadley
Thanks for your code Jim. It's really great! When using the FormAnimator class everything works great. The only problem is that when my date time picker is displayed it's viewed as sunk down in the form and it lost it's blue border like my combo box has. Do you have any idea on how to fix that problem? is it a property on my date time picker? I tried to look for the border property on the date time picker and realized that wasn't there. Any help will be appreciated.
If you don't use the FormAnimator does that not happen? It sounds like it's not getting drawn using visual styles for some reason. If you minimise the form and restore it does it get drawn properly then?
-
Mar 19th, 2008, 09:11 AM
#72
Junior Member
Re: Animated Window Effects with "Toast" popup demo
Yes you are correct. If I don't use the Form Animator everything works fine. Also, when I minimize the form it goes back to the original state. I also have a drop down combo box right above the date time picker and once it is dropped over the date time picker and restored the date time picker goes back to the original state as well.
-
Mar 19th, 2008, 09:32 AM
#73
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by Tim Hadley
Yes you are correct. If I don't use the Form Animator everything works fine. Also, when I minimize the form it goes back to the original state. I also have a drop down combo box right above the date time picker and once it is dropped over the date time picker and restored the date time picker goes back to the original state as well.
I can't tell you exactly why but the DTP is obviously not getting drawn using visual styles the first time. A workaround would be to handle the form's Shown event (assuming .NET 2.0+) and call the DTP's Refresh method to force an immediate repaint. I guess the DTP may not look right during the animation but that's the best I've got for you I'm afraid.
-
Mar 19th, 2008, 09:56 AM
#74
Junior Member
Re: Animated Window Effects with "Toast" popup demo
Thanks! That seemed to work just fine after the form loads. I did the form' shown event and did a me.refresh and that took care of the date time picker being drawn right. Thanks for all your help!
-
Mar 19th, 2008, 05:37 PM
#75
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by Tim Hadley
Thanks! That seemed to work just fine after the form loads. I did the form' shown event and did a me.refresh and that took care of the date time picker being drawn right. Thanks for all your help!
You shouldn't call Me.Refresh. That will redraw the entire form, which is not needed. If you read my post again you'll see I said call the Refresh method of the DateTimePicker, not the form. If the DTP is all that needs to be repainted then that's all you should repaint.
-
Jun 5th, 2008, 12:00 PM
#76
Fanatic Member
Re: Animated Window Effects with "Toast" popup demo
Has there been any updates/replacements to this code since 2006 and the advent of framework3.5 ?
-
Jun 5th, 2008, 06:31 PM
#77
Re: Animated Window Effects with "Toast" popup demo
Originally Posted by Xancholy
Has there been any updates/replacements to this code since 2006 and the advent of framework3.5 ?
The principles in this thread use the Windows API, which hasn't changed in XP at least. I don't know if there's anything new in Vista on this front. .NET 3.5 includes no new functionality that can replace the unmanaged code so everything would be exactly the same.
-
Jun 5th, 2008, 08:16 PM
#78
Fanatic Member
Re: Animated Window Effects with "Toast" popup demo
Can you please tell me which posting number contains the most updated code ?
-
Jun 5th, 2008, 08:22 PM
#79
Re: Animated Window Effects with "Toast" popup demo
Whenever I update attached files in one of my CodeBank threads I always attach it to the first post and replace the old code, unless I have a specific reason to do otherwise.
-
Jun 6th, 2008, 05:46 AM
#80
Fanatic Member
Re: Animated Window Effects with "Toast" popup demo
Best practice. My only request would be to please include a sample image of toast in action... thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|